summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-08-09 11:59:44 +0100
committerGitHub <noreply@github.com>2024-08-09 11:59:44 +0100
commit70b0e386032ed2f3ecf25fcf9a4b6c31335ffdc4 (patch)
treeaf2d4124991c6044485d7fdf203a24b8c21c7410 /synapse/storage
parentStart handlers for new media endpoints when media resource configured (#17483) (diff)
downloadsynapse-70b0e386032ed2f3ecf25fcf9a4b6c31335ffdc4.tar.xz
Fix performance of device lists in `/key/changes` and sliding sync (#17537) HEAD github/develop develop
We do this by reusing the code from sync v2.

Reviewable commit-by-commit. The function `get_user_ids_changed` has
been rewritten entirely, so I would recommend not looking at the diff.
Diffstat (limited to '')
-rw-r--r--synapse/storage/databases/main/state_deltas.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/state_deltas.py b/synapse/storage/databases/main/state_deltas.py
index 9ed39e688a..7d491d1728 100644
--- a/synapse/storage/databases/main/state_deltas.py
+++ b/synapse/storage/databases/main/state_deltas.py
@@ -166,6 +166,11 @@ class StateDeltasStore(SQLBaseStore):
     ) -> List[StateDelta]:
         """Get the state deltas between two tokens."""
 
+        if not self._curr_state_delta_stream_cache.has_entity_changed(
+            room_id, from_token.stream
+        ):
+            return []
+
         def get_current_state_deltas_for_room_txn(
             txn: LoggingTransaction,
         ) -> List[StateDelta]: