-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stale device lists #2305
Comments
Some possible strategies for fixing:
|
This also happens even if Bob and Alice have never shared a room; Alice's client may still have cached an old list if she opened Bob's memberinfo. |
I confirm that this happens pretty frequently in my experience. |
@giordy: this bug is something of an edge-case; it is unlikely you are seeing exactly this. There are several potential causes of "Unknown inbound session ID" (many of them currently related to work still to be done on the mobile clients). |
@richvdh ok thanks for the clarification! |
This is slightly tricky to fix from Alice's end. She can listen for new members while she is online, and do a device list download when she sees one, but that doesn't help when she is offline. During an intialsync, she can't tell the users who joined since she was last online from those who were there before (and she should thus expect to have an up-to-date device list for, or new_device events for). Another idea would be to send a new_device event to all existing members when you join a room, thus prompting them to download your device list when they come online. However, this relies on the join events being well-ordered, which they are not (Alice and Bob could join at the same time on different servers; each of them see the room without the other when they first join; neither sends the other new_device events, expecting the other to sort it out). We could just refresh the devicelist for all users in all encrypted rooms at the end of intialsync. This might be a bit high-traffic. We could be a bit more intelligent in our caching, and store the timestamp of the devicelist response; then refresh the devicelist if we see join events (or new_device events) after that time. Probably requires server support to give us a timestamp, though. |
I've been thinking about this a bit more. I've realised the current method of sending
Alternatively:
In either of these situations, Alice has a stale copy of Bob's device list. Worse, this situation persists until Alice has cause to refresh the device list. The fundamental problem here is that the One solution would be to record, in the room state, a sequence number (could be a timestamp, any monotonically increasing number will do) which increases each time you update the device list. Similarly, the device list results would contain a corresponding sequence number, which you record alongside your cache. When you see that a member's device sequence state is higher than your cached version, you know the cache is out of date. |
I discussed my proposed solution with Erik. He suggested that:
|
Modulo #3126, this should be fixed as of riot v0.9.7 and synapse v0.19.0. |
Still broken. We don't update the device list of users when they join an e2e room. I think we need to update the device list when we first see the user join an e2e room. To do this right, we probably need to maintain a flag which tracks whether we are keeping the device list for a given user up-to-date. |
Yet another attempt at fixing element-hq/element-web#2305. This now implements the algorithm described at http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#tracking-the-device-list-for-a-user: * We now keep a flag to tell us which users' device lists we are tracking. That makes it much easier to figure out whether we should care about device-update notifications from /sync (thereby fixing element-hq/element-web#3588). * We use the same flag to indicate whether the device list for a particular user is out of date. Previously we did this implicitly by only updating the stored sync token when the list had been updated, but that was somewhat complicated, and in any case didn't help in cases where we initiated the key download due to a user joining an encrypted room. Also fixes element-hq/element-web#3310.
Yet another attempt at fixing element-hq/element-web#2305. This now implements the algorithm described at http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#tracking-the-device-list-for-a-user: * We now keep a flag to tell us which users' device lists we are tracking. That makes it much easier to figure out whether we should care about device-update notifications from /sync (thereby fixing element-hq/element-web#3588). * We use the same flag to indicate whether the device list for a particular user is out of date. Previously we did this implicitly by only updating the stored sync token when the list had been updated, but that was somewhat complicated, and in any case didn't help in cases where we initiated the key download due to a user joining an encrypted room. Also fixes element-hq/element-web#3310.
Yet another attempt at fixing element-hq/element-web#2305. This now implements the algorithm described at http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#tracking-the-device-list-for-a-user: * We now keep a flag to tell us which users' device lists we are tracking. That makes it much easier to figure out whether we should care about device-update notifications from /sync (thereby fixing element-hq/element-web#3588). * We use the same flag to indicate whether the device list for a particular user is out of date. Previously we did this implicitly by only updating the stored sync token when the list had been updated, but that was somewhat complicated, and in any case didn't help in cases where we initiated the key download due to a user joining an encrypted room. Also fixes element-hq/element-web#3310.
Hopefully finally fixed by matrix-org/matrix-js-sdk#425 |
We now rely on the server to track new devices, and tell us about them when users add them, rather than forcing devices to announce themselves (see element-hq/element-web#2305 for the whole backstory there). The necessary support for that has now been in all the clients and the server for several months (since March or so). I now want to get rid of the localstorage store, which this code is relying on, so now seems like a good time to get rid of it. Yay.
STR:
The problem here is that Alice's client is using a stale device list for Bob.
It's a bit of an edge case, since it requires doing a complicated dance of leaving and joining rooms and logging in on new devices - but it's an edge case that people tend to hit during testing.
The text was updated successfully, but these errors were encountered: