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

When leaving the last room shared with a remote user, the remote user is missing from device_lists.left in the /sync response, even when lazy_load_members is off #13650

Open
squahtx opened this issue Aug 26, 2022 · 2 comments
Labels
A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. A-Sync defects related to /sync O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@squahtx
Copy link
Contributor

squahtx commented Aug 26, 2022

  1. Have a room with one local user, @alice:local and one remote user, @bob:remote.
  2. Have @alice:local leave the room.
  3. @alice:local does not observe @bob:remote in the device_lists.left section of /sync.
  4. [If @bob:remote then updates their device list and @alice:local does a /keys/query request, the correct response is returned. This part is working.]
  5. [If @alice:local rejoins the room, I believe device_lists.changed will contain @bob:remote, so nothing should break here.]

Not tested with lazy_load_members yet. I presume it's similarly buggy and even trickier to fix.

@squahtx squahtx added A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. A-Sync defects related to /sync S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Aug 26, 2022
@squahtx squahtx self-assigned this Aug 26, 2022
@squahtx
Copy link
Contributor Author

squahtx commented Aug 30, 2022

This might only happen when the local homeserver is no longer in the room. Synapse uses the set of members currently in the room at /sync time to drive device_lists.left:

# Now find users that we no longer track
for room_id in newly_left_rooms:
left_users = await self.store.get_users_in_room(room_id)
newly_left_users.update(left_users)

When Synapse is no longer in the room, it no longer has the current state and so doesn't know which remote users to include in device_lists.left at /sync time.

Also it's rather dubious to be using the current members of the room rather than the members at the time the local user left.

@squahtx squahtx removed their assignment Sep 9, 2022
@squahtx
Copy link
Contributor Author

squahtx commented Sep 9, 2022

There is a complement test covering this bug in: matrix-org/complement#459

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. A-Sync defects related to /sync O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

1 participant