summary refs log tree commit diff
path: root/synapse/handlers/typing.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-12-05 20:19:14 +0000
committerGitHub <noreply@github.com>2022-12-05 15:19:14 -0500
commitcee9445884eb62c070fb0b03a112a862e8dea7c4 (patch)
treee373ccf91b0b42fe285d077282a332f841b82281 /synapse/handlers/typing.py
parentCompare to the earliest known stream pos in the stream change cache. (#14435) (diff)
downloadsynapse-cee9445884eb62c070fb0b03a112a862e8dea7c4.tar.xz
Better return type for `get_all_entities_changed` (#14604)
Help callers from using the return value incorrectly by ensuring
that callers explicitly check if there was a cache hit or not.
Diffstat (limited to 'synapse/handlers/typing.py')
-rw-r--r--synapse/handlers/typing.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/handlers/typing.py b/synapse/handlers/typing.py
index a0ea719430..3f656ea4f5 100644
--- a/synapse/handlers/typing.py
+++ b/synapse/handlers/typing.py
@@ -420,11 +420,11 @@ class TypingWriterHandler(FollowerTypingHandler):
         if last_id == current_id:
             return [], current_id, False
 
-        changed_rooms: Optional[
-            Iterable[str]
-        ] = self._typing_stream_change_cache.get_all_entities_changed(last_id)
+        result = self._typing_stream_change_cache.get_all_entities_changed(last_id)
 
-        if changed_rooms is None:
+        if result.hit:
+            changed_rooms: Iterable[str] = result.entities
+        else:
             changed_rooms = self._room_serials
 
         rows = []