mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-23 21:45:46 +00:00
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.
This commit is contained in:
1 file changed
+2
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user