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/sync.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/sync.py')
-rw-r--r-- | synapse/handlers/sync.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index c8858b22dd..0b395a104d 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -1528,10 +1528,12 @@ class SyncHandler: # # If we don't have that info cached then we get all the users that # share a room with our user and check if those users have changed. - changed_users = self.store.get_cached_device_list_changes( + cache_result = self.store.get_cached_device_list_changes( since_token.device_list_key ) - if changed_users is not None: + if cache_result.hit: + changed_users = cache_result.entities + result = await self.store.get_rooms_for_users(changed_users) for changed_user_id, entries in result.items(): |