summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-09-18 09:29:05 -0400
committerGitHub <noreply@github.com>2023-09-18 09:29:05 -0400
commit85bfd4735e0b6e31d530f692d7113b4fec89e6b3 (patch)
treeba291181d0d7188c024cf4171126e762381d8be5 /synapse/handlers
parentAdditional validation of receipts (#16327) (diff)
downloadsynapse-85bfd4735e0b6e31d530f692d7113b4fec89e6b3.tar.xz
Return an immutable value from get_latest_event_ids_in_room. (#16326)
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation_event.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index d32d224d56..eedde97ab0 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -723,12 +723,11 @@ class FederationEventHandler:
         if not prevs - seen:
             return
 
-        latest_list = await self._store.get_latest_event_ids_in_room(room_id)
+        latest_frozen = await self._store.get_latest_event_ids_in_room(room_id)
 
         # We add the prev events that we have seen to the latest
         # list to ensure the remote server doesn't give them to us
-        latest = set(latest_list)
-        latest |= seen
+        latest = seen | latest_frozen
 
         logger.info(
             "Requesting missing events between %s and %s",
@@ -1976,8 +1975,7 @@ class FederationEventHandler:
             # partial and full state and may not be accurate.
             return
 
-        extrem_ids_list = await self._store.get_latest_event_ids_in_room(event.room_id)
-        extrem_ids = set(extrem_ids_list)
+        extrem_ids = await self._store.get_latest_event_ids_in_room(event.room_id)
         prev_event_ids = set(event.prev_event_ids())
 
         if extrem_ids == prev_event_ids: