Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 7fee8fe

Browse files
committed
Only send out device list updates for our own users
Broke in #12365
1 parent 0922462 commit 7fee8fe

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

synapse/handlers/device.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,13 @@ async def _handle_new_device_update_async(self) -> None:
649649
return
650650

651651
for user_id, device_id, room_id, stream_id, opentracing_context in rows:
652-
joined_user_ids = await self.store.get_users_in_room(room_id)
653-
hosts = {get_domain_from_id(u) for u in joined_user_ids}
654-
hosts.discard(self.server_name)
652+
hosts = set()
653+
654+
# Ignore any users that aren't ours
655+
if self.hs.is_mine_id(user_id):
656+
joined_user_ids = await self.store.get_users_in_room(room_id)
657+
hosts = {get_domain_from_id(u) for u in joined_user_ids}
658+
hosts.discard(self.server_name)
655659

656660
# Check if we've already sent this update to some hosts
657661
if current_stream_id == stream_id:

synapse/storage/databases/main/devices.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,9 @@ def _add_device_outbound_poke_to_stream_txn(
17031703
next(stream_id_iterator),
17041704
user_id,
17051705
device_id,
1706-
False,
1706+
not self.hs.is_mine_id(
1707+
user_id
1708+
), # We only need to send out update for *our* users
17071709
now,
17081710
encoded_context if whitelisted_homeserver(destination) else "{}",
17091711
)

0 commit comments

Comments
 (0)