dendrite/userapi
texuf 46f0ed379a Hack out read receipt de-duping protection
zion hack - always send the notification data on a read receipt
the notifications are stored in two different databases, and somehow the notification database
prunes data, so trying to mark old notifications as read will fail, but the notification will still exist in the other db
todo, revist when this refactor lands: https://github.com/matrix-org/dendrite/pull/2688/files

 it looks like we cleanup the notification table after a day

func (s *notificationsStatements) Clean(ctx context.Context, txn *sql.Tx) error {
	_, err := sqlutil.TxStmt(txn, s.cleanNotificationsStmt).ExecContext(
		ctx,
		time.Now().AddDate(0, 0, -1).UnixNano()/int64(time.Millisecond), // keep non-highlights for a day
		time.Now().AddDate(0, -1, 0).UnixNano()/int64(time.Millisecond), // keep highlights for a month
	)
	return err
}
But we don't clean up the notifications in the syncAPI table.

When we send a read receipt we first do a updated _, err := s.db.SetNotificationsRead(ctx, localpart, roomID, int64(read.Read), true) and only forward the message on if the table was updated. If a user waits more than a day to send a read receipt, they can't clear their notifications.
2022-09-15 10:33:39 -07:00
..
api Use /admin/v1/register in create-account (#2484) 2022-08-12 12:00:07 +01:00
consumers Hack out read receipt de-duping protection 2022-09-15 10:33:39 -07:00
internal Update getting pushrules, add tests, tweak pushrules (#2705) 2022-09-09 13:56:33 +02:00
inthttp Generic-based internal HTTP API (#2626) 2022-08-11 15:29:33 +01:00
producers Make the User API responsible for sending account data output events (#2592) 2022-07-25 17:30:07 +01:00
storage Fix test checking which clients connected 2022-09-09 19:04:37 -07:00
types Add opt-in anonymous stats reporting (#2249) 2022-05-04 19:04:28 +02:00
util Update FAQ 2022-07-19 11:51:46 +01:00
userapi.go Update getting pushrules, add tests, tweak pushrules (#2705) 2022-09-09 13:56:33 +02:00
userapi_test.go Generic-based internal HTTP API (#2626) 2022-08-11 15:29:33 +01:00