summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorNicolas Werner <89468146+nico-famedly@users.noreply.github.com>2023-06-21 15:56:31 +0200
committerGitHub <noreply@github.com>2023-06-21 14:56:31 +0100
commite0c39d6bb526b01368393ae5d2173c8e6d39b60f (patch)
tree9ec2262342e86043ef8df1ae5560dd76cd509fbd /synapse
parentFix harmless exception in port DB script (#15814) (diff)
downloadsynapse-e0c39d6bb526b01368393ae5d2173c8e6d39b60f.tar.xz
Fix forgotten rooms missing in initial sync (#15815)
If you leave a room and forget it, then rejoin it, the room would be
missing from the next initial sync.

fixes #13262

Signed-off-by: Nicolas Werner <n.werner@famedly.com>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/databases/main/cache.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/cache.py b/synapse/storage/databases/main/cache.py
index 6e1c7d681f..c940f864d1 100644
--- a/synapse/storage/databases/main/cache.py
+++ b/synapse/storage/databases/main/cache.py
@@ -289,6 +289,17 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
             )
             self._attempt_to_invalidate_cache("get_rooms_for_user", (state_key,))
 
+            self._attempt_to_invalidate_cache(
+                "did_forget",
+                (
+                    state_key,
+                    room_id,
+                ),
+            )
+            self._attempt_to_invalidate_cache(
+                "get_forgotten_rooms_for_user", (state_key,)
+            )
+
         if relates_to:
             self._attempt_to_invalidate_cache("get_relations_for_event", (relates_to,))
             self._attempt_to_invalidate_cache("get_references_for_event", (relates_to,))
@@ -336,6 +347,8 @@ class CacheInvalidationWorkerStore(SQLBaseStore):
             "get_rooms_for_user_with_stream_ordering", None
         )
         self._attempt_to_invalidate_cache("get_rooms_for_user", None)
+        self._attempt_to_invalidate_cache("did_forget", None)
+        self._attempt_to_invalidate_cache("get_forgotten_rooms_for_user", None)
         self._attempt_to_invalidate_cache("get_references_for_event", None)
         self._attempt_to_invalidate_cache("get_thread_summary", None)
         self._attempt_to_invalidate_cache("get_thread_participated", None)