summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2025-01-08 10:11:09 -0600
committerGitHub <noreply@github.com>2025-01-08 10:11:09 -0600
commitaab3672037ee9ea71c54c89c86d9c0cc35ae184f (patch)
tree6dda0c9b0df658b8b6b9a7f406a90f5af63e3dd7 /synapse/storage/_base.py
parentBump jinja2 from 3.1.4 to 3.1.5 (#18067) (diff)
downloadsynapse-aab3672037ee9ea71c54c89c86d9c0cc35ae184f.tar.xz
Bust `_membership_stream_cache` cache when current state changes (#17732)
This is particularly a problem in a state reset scenario where the membership
might change without a corresponding event.

This PR is targeting a scenario where a state reset happens which causes
room membership to change. Previously, the cache would just hold onto
stale data and now we properly bust the cache in this scenario.

We have a few tests for these scenarios which you can see are now fixed
because we can remove the `FIXME` where we were previously manually
busting the cache in the test itself.

This is a general Synapse thing so by it's nature it helps out Sliding
Sync.

Fix https://github.com/element-hq/synapse/issues/17368

Prerequisite for https://github.com/element-hq/synapse/issues/17929

---

Match when are busting `_curr_state_delta_stream_cache`
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py

index e14d711c76..7251e72e3a 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py
@@ -86,7 +86,9 @@ class SQLBaseStore(metaclass=ABCMeta): """ def _invalidate_state_caches( - self, room_id: str, members_changed: Collection[str] + self, + room_id: str, + members_changed: Collection[str], ) -> None: """Invalidates caches that are based on the current state, but does not stream invalidations down replication.