-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Rework device list tracking logic #425
Conversation
(should also indirectly help with element-hq/element-web#3660, since it will mean we are less likely to fill up the localstorage for device lists we don't care about) |
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.
09860b5
to
ab19b9b
Compare
There's a lot of console.log being added. I assume it's there for debugging unknown session/key errors in the wild. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this LGTM?
well, I'm not sure it's a lot - most of them are just being moved around. But yeah, it's basically to try to debug uisis. |
Now amended by #431. |
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 Sending a message in a 1:1 E2E room triggers explosion of downloading device keys, which takes minutes 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.