From f4da96123a9b42852a4daf69c22784f3652e0b8f Mon Sep 17 00:00:00 2001 From: Paul Chobert Date: Wed, 30 Sep 2026 10:42:07 +0200 Subject: [PATCH] Correct the comment on the summarised threads top-up The comment said looking up the thread's counts may create a new entry. It cannot: threads that are not in `summarised_threads` are skipped, and every thread in that set was given an entry by the loop over the summary rows. --- synapse/storage/databases/main/event_push_actions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/synapse/storage/databases/main/event_push_actions.py b/synapse/storage/databases/main/event_push_actions.py index 03a001994c..8684ee0c87 100644 --- a/synapse/storage/databases/main/event_push_actions.py +++ b/synapse/storage/databases/main/event_push_actions.py @@ -701,11 +701,8 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas if thread_id not in summarised_threads: continue - # Note that previous thread summaries of 0 are discarded above, so this - # may create a new entry. - # - # TODO If empty summaries are deleted this can use `thread_counts` - # directly. + # Every thread in `summarised_threads` was given an entry by the loop + # over the summary rows above, so this only tops up an existing count. counts = _get_thread(thread_id) counts.notify_count += notif_count counts.unread_count += unread_count