From c9b5fcaaeb9a717134f0f218f0555ba88035fb37 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 11 Jan 2024 11:30:32 +0000 Subject: [PATCH] Update synapse/storage/databases/main/event_push_actions.py Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- synapse/storage/databases/main/event_push_actions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/synapse/storage/databases/main/event_push_actions.py b/synapse/storage/databases/main/event_push_actions.py index c01b88cc1ca..6d4e2942ea7 100644 --- a/synapse/storage/databases/main/event_push_actions.py +++ b/synapse/storage/databases/main/event_push_actions.py @@ -439,6 +439,11 @@ def _get_unread_counts_by_room_for_user_txn( room_to_count[room_id] += notif_count elif stream_ordering > receipt_stream_ordering: room_to_count[room_id] += notif_count + else: + # The latest read receipt from the user is after all the rows for + # this room in `event_push_summary`. We ignore them, and + # calculate the count from `event_push_actions` in step 3. + pass elif last_receipt_stream_ordering == receipt_stream_ordering: room_to_count[room_id] += notif_count else: