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

Synapse doesn't send out device list updates to previously unseen homeservers when joining a room #11374

Open
anoadragon453 opened this issue Nov 17, 2021 · 2 comments
Labels
A-Spec-Compliance places where synapse does not conform to the spec S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@anoadragon453
Copy link
Member

anoadragon453 commented Nov 17, 2021

The spec says that:

Servers must send m.device_list_update EDUs to all the servers who share a room with a given local user, and must be sent whenever that user’s device list changes (i.e. for new or deleted devices, when that user joins a room which contains servers which are not already receiving updates for that user’s device list, or changes in device information such as the device’s human-readable name).

Which to be clear, means that upon a local user joining a room, we should:

  1. Check if any of the other homeservers in the room are new to us (their users don't share any other rooms with us)
  2. Send device list updates of the joining user to those homeservers.

It doesn't appear that Synapse actually does this anywhere, currently.

We also need to do this for presence (#8956), but the current presence-related TODO in the code may be a good inspiration for what a device list related implementation would look like:

if not newly_joined_users:
# If nobody has joined then there's nothing to do.
return
# We want to send:
# 1. presence states of all local users in the room to newly joined
# remote servers
# 2. presence states of newly joined users to all remote servers in
# the room.
#
# TODO: Only send presence states to remote hosts that don't already
# have them (because they already share rooms).

@anoadragon453 anoadragon453 changed the title Synapse doesn't appear to send out device list updates to previously unseen homeservers when joining a room Synapse doesn't send out device list updates to previously unseen homeservers when joining a room Nov 17, 2021
@anoadragon453 anoadragon453 added the A-Spec-Compliance places where synapse does not conform to the spec label Nov 17, 2021
@uhoreg
Copy link
Member

uhoreg commented Nov 17, 2021

Probably makes sense to make sure that m.signing_key_update is sent in that case too.

@DMRobertson DMRobertson added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Nov 18, 2021
@anoadragon453
Copy link
Member Author

Note that when a user joins a room, that user's /sync stream is populated with all other user IDs from the room:

# Step 1b, check for newly joined rooms
for room_id in newly_joined_rooms:
joined_users = await self.store.get_users_in_room(room_id)
newly_joined_or_invited_or_knocked_users.update(joined_users)

But that still doesn't help remote users when we join a room.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

3 participants