Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 8974777

Browse files
committed
Re-fix handling of receipts with no event stream ordering
1 parent 1f11abc commit 8974777

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

synapse/storage/databases/main/event_push_actions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,17 @@ def _get_notif_unread_count_for_user_room(
791791
each thread.
792792
"""
793793

794+
# This happens when no event is associated with an event which happens
795+
# due to unknown reasons: https://github.com/matrix-org/synapse/commit/9f797a24a452a513628263b1b03172cee20a9856
796+
# We are assuming here that the receipt is for the latest event in the
797+
# room which is the most regular situation.
798+
# TODO: fix this? Why does it not affect matrix.org?
799+
if stream_ordering is None:
800+
return []
801+
794802
# If there have been no events in the room since the stream ordering,
795803
# there can't be any push actions either.
796-
if stream_ordering and not self._events_stream_cache.has_entity_changed(
804+
if not self._events_stream_cache.has_entity_changed(
797805
room_id, stream_ordering, max_stream_ordering
798806
):
799807
return []

0 commit comments

Comments
 (0)