mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 07:52:13 -04:00
Properly handle unknown results for the stream change cache. (#14592)
StreamChangeCache.get_all_changed_entities can return None to signify it does not have information at the given stream position. Two callers (related to device lists and presence) were treating this response the same as an empty list (i.e. there being no updates).
This commit is contained in:
parent
6acb6d772a
commit
fac8a38525
3 changed files with 22 additions and 16 deletions
|
@ -1764,14 +1764,14 @@ class PresenceEventSource(EventSource[int, UserPresenceState]):
|
|||
Returns:
|
||||
A list of presence states for the given user to receive.
|
||||
"""
|
||||
updated_users = None
|
||||
if from_key:
|
||||
# Only return updates since the last sync
|
||||
updated_users = self.store.presence_stream_cache.get_all_entities_changed(
|
||||
from_key
|
||||
)
|
||||
if not updated_users:
|
||||
updated_users = []
|
||||
|
||||
if updated_users is not None:
|
||||
# Get the actual presence update for each change
|
||||
users_to_state = await self.get_presence_handler().current_state_for_users(
|
||||
updated_users
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue