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

device list can get out of sync because you don't get m.device_list_updates unless you share a room with that user (causing UISIs) #6399

Closed
ara4n opened this issue Nov 22, 2019 · 2 comments
Assignees
Labels
A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. z-bug (Deprecated Label) z-uisi (Deprecated Label)

Comments

@ara4n
Copy link
Member

ara4n commented Nov 22, 2019

@benbz's server has ended up in a spectacular mess where its device_lists for me & Amandine are several years old - log details in https://github.com/matrix-org/riot-ios-rageshakes/issues/3483.

I have a hunch that what's happened is that:

  • Ben sets up server
  • Temporarily joins some (encrypted?) room, years ago, thus getting a copy of Amandine & my keys
  • Subsequently is in a private room with us which gets upgraded to E2E
  • ...but the upgrade to E2E doesn't trigger a check of our device lists by calling matrix://matrix.org/_matrix/federation/v1/user/keys/query, so the server blindly uses the ancient E2E keys.
  • Amandine & I rarely log in on our main accounts, so we never send new m.device_list_update EDUs from matrix.org, so the device list is never corrected.

This is kinda similar to #4827 or #5433.

Possible solutions:

  • If you receive a reference to an unrecognised device from a server, you should refresh your cache of that user's devicelist (useful defensive measure anyway)
  • Ensure that device list caches are flushed when you lose contact with a user, or re-populated when you regain contact
@ara4n ara4n added p1 z-bug (Deprecated Label) labels Nov 22, 2019
@ara4n ara4n changed the title device list can get out of sync because you don't get device_list_updates unless you share a room that user? device list can get out of sync because you don't get m.device_list_updates unless you share a room with that user? Nov 22, 2019
@benbz
Copy link
Contributor

benbz commented Nov 22, 2019

I set this HS up in late 2017 and I recall that I joined #offtopic:matrix.org for a short while before leaving that room. I didn’t use this HS for anything other than talking to TomL until very recently

@ara4n ara4n changed the title device list can get out of sync because you don't get m.device_list_updates unless you share a room with that user? device list can get out of sync because you don't get m.device_list_updates unless you share a room with that user (causing UISIs) Dec 16, 2019
@ara4n
Copy link
Member Author

ara4n commented Dec 16, 2019

from a related Tchap issue:

add_messages_to_device_inbox experienced a database failure and couldn't send a to_device message to another user. Checking whether this function is tolerant to failures and its job retried afterwards may help fix things.

@erikjohnston erikjohnston self-assigned this Jan 6, 2020
@richvdh richvdh added A-Device-List-Tracking Telling clients about other devices. Often related to E2EE. z-uisi (Deprecated Label) labels Feb 5, 2020
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. z-bug (Deprecated Label) z-uisi (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

5 participants