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

Commit

Permalink
Re-fix handling of receipts with no event stream ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Dec 15, 2022
1 parent 1f11abc commit 8974777
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,17 @@ def _get_notif_unread_count_for_user_room(
each thread.
"""

# This happens when no event is associated with an event which happens
# due to unknown reasons: https://github.com/matrix-org/synapse/commit/9f797a24a452a513628263b1b03172cee20a9856
# We are assuming here that the receipt is for the latest event in the
# room which is the most regular situation.
# TODO: fix this? Why does it not affect matrix.org?
if stream_ordering is None:
return []

# If there have been no events in the room since the stream ordering,
# there can't be any push actions either.
if stream_ordering and not self._events_stream_cache.has_entity_changed(
if not self._events_stream_cache.has_entity_changed(
room_id, stream_ordering, max_stream_ordering
):
return []
Expand Down

0 comments on commit 8974777

Please sign in to comment.