diff options
author | Erik Johnston <erik@matrix.org> | 2022-12-05 20:19:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-05 15:19:14 -0500 |
commit | cee9445884eb62c070fb0b03a112a862e8dea7c4 (patch) | |
tree | e373ccf91b0b42fe285d077282a332f841b82281 /synapse/handlers/typing.py | |
parent | Compare to the earliest known stream pos in the stream change cache. (#14435) (diff) | |
download | synapse-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.py | 8 |
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 = [] |