summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-05-05 18:36:17 +0100
committerRichard van der Hoff <richard@matrix.org>2020-05-05 18:36:17 +0100
commit1c24e35e85b29d31e3e9db51edf74866f577a144 (patch)
tree25f6130e72fe74821a398cd305cce5ceee8f9784 /synapse/handlers/sync.py
parentFix redis password support (diff)
parentUpdate changelog.d/7423.misc (diff)
downloadsynapse-1c24e35e85b29d31e3e9db51edf74866f577a144.tar.xz
Merge erikj/faster_device_lists_fetch into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py

index d15efd474e..6c49e821d9 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py
@@ -1146,10 +1146,14 @@ class SyncHandler(object): user_id ) - tracked_users = set(users_who_share_room) - - # Always tell the user about their own devices - tracked_users.add(user_id) + # Always tell the user about their own devices. We check as the user + # ID is almost certainly already included (unless they're not in any + # rooms) and taking a copy of the set is relatively expensive. + if user_id not in users_who_share_room: + users_who_share_room = set(users_who_share_room) + users_who_share_room.add(user_id) + + tracked_users = users_who_share_room # Step 1a, check for changes in devices of users we share a room with users_that_have_changed = await self.store.get_users_whose_devices_changed(