summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2024-05-18 16:12:46 +0100
committerErik Johnston <erik@matrix.org>2024-05-18 16:12:46 +0100
commit6a0d2dc6fc48ae51b3a62d7eca730a66774746af (patch)
treeb9af23f2d7e8bec986939f69d2ce33a97dd48ece
parentNewsfile (diff)
downloadsynapse-6a0d2dc6fc48ae51b3a62d7eca730a66774746af.tar.xz
Only check for all rooms if not outbound poke
-rw-r--r--synapse/replication/tcp/client.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py
index cff88a87ec..2d6d49eed7 100644
--- a/synapse/replication/tcp/client.py
+++ b/synapse/replication/tcp/client.py
@@ -114,11 +114,12 @@ class ReplicationDataHandler:
         """
         all_room_ids: Set[str] = set()
         if stream_name == DeviceListsStream.NAME:
-            prev_token = self.store.get_device_stream_token()
-            all_room_ids = await self.store.get_all_device_list_changes(
-                prev_token, token
-            )
-            self.store.device_lists_in_rooms_have_changed(all_room_ids, token)
+            if any(row.entity.startswith("@") and not row.is_signature for row in rows):
+                prev_token = self.store.get_device_stream_token()
+                all_room_ids = await self.store.get_all_device_list_changes(
+                    prev_token, token
+                )
+                self.store.device_lists_in_rooms_have_changed(all_room_ids, token)
 
         self.store.process_replication_rows(stream_name, instance_name, token, rows)
         # NOTE: this must be called after process_replication_rows to ensure any