summary refs log tree commit diff
path: root/synapse/handlers/typing.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-05-31 16:07:05 +0100
committerGitHub <noreply@github.com>2024-05-31 16:07:05 +0100
commit5c2a837e3cb3eb307f080a7991f464598f43f283 (patch)
tree8f4008b44ae04fd9355d7d64f1b8319a1bbab265 /synapse/handlers/typing.py
parentFix logging errors when receiving invalid User ID for key querys (#17250) (diff)
downloadsynapse-5c2a837e3cb3eb307f080a7991f464598f43f283.tar.xz
Fix bug where typing replication breaks (#17252)
This can happen on restarts of the service, due to old rooms being
pruned.
Diffstat (limited to 'synapse/handlers/typing.py')
-rw-r--r--synapse/handlers/typing.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/typing.py b/synapse/handlers/typing.py
index 7619d91c98..4c87718337 100644
--- a/synapse/handlers/typing.py
+++ b/synapse/handlers/typing.py
@@ -477,9 +477,9 @@ class TypingWriterHandler(FollowerTypingHandler):
 
         rows = []
         for room_id in changed_rooms:
-            serial = self._room_serials[room_id]
-            if last_id < serial <= current_id:
-                typing = self._room_typing[room_id]
+            serial = self._room_serials.get(room_id)
+            if serial and last_id < serial <= current_id:
+                typing = self._room_typing.get(room_id, set())
                 rows.append((serial, [room_id, list(typing)]))
         rows.sort()