Skip to content

Commit

Permalink
Correctly invalidate cache on replication
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier authored and guillaumevillemont committed Jul 29, 2022
1 parent 9f26348 commit 46f56b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion synapse/storage/databases/main/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,13 @@ def _process_event_stream_row(self, token: int, row: EventsStreamRow) -> None:
self._curr_state_delta_stream_cache.entity_has_changed(data.room_id, token)

if data.type == EventTypes.Member:
# We need to invalidate the cache for get_rooms_for_user_with_stream_ordering
# both with and without excluding rooms for sync results.
self.get_rooms_for_user_with_stream_ordering.invalidate(
(data.state_key,)
(data.state_key, False)
)
self.get_rooms_for_user_with_stream_ordering.invalidate(
(data.state_key, True)
)
else:
raise Exception("Unknown events stream row type %s" % (row.type,))
Expand Down

0 comments on commit 46f56b4

Please sign in to comment.