-
Notifications
You must be signed in to change notification settings - Fork 246
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
fix(sdk): Mark tracked users as dirty when the SS connection is reset. #3965
fix(sdk): Mark tracked users as dirty when the SS connection is reset. #3965
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3965 +/- ##
==========================================
+ Coverage 84.27% 84.31% +0.03%
==========================================
Files 267 267
Lines 28296 28323 +27
==========================================
+ Hits 23846 23880 +34
+ Misses 4450 4443 -7 ☔ View full report in Codecov by Sentry. |
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.
Left some nits, I think it generally does what it should do.
let account = vodozemac::olm::Account::new(); | ||
|
||
// Put some tracked users | ||
let damir = user_id!("@damir:localhost"); |
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.
❤️
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.
❤️
It's worth emphasising here that this will negatively impact performance and bandwidth, as the rust SDK will be doing many more |
dc004b4
to
62cf64c
Compare
This patch adds the `OldMachine::mark_all_tracked_users_as_dirty`. This patch rewrites a bit `OlmMachine::new_helper` by extracting some piece of it inside `OlmMachine::new_helper_prelude`. With that, we can rewrite `OlmMachine::migration_post_verified_latch_support` to use `IdentityManager::mark_all_tracked_users_as_dirty`. This latter is the shared implementation with `OlmMachine::mark_all_tracked_users_as_dirty`. This patch adds a test for `OlmMachine:mark_all_tracked_users_as_dirty`.
62cf64c
to
c0bb278
Compare
There is a non-negligible difference MSC3575 and MSC4186 in how the `e2ee` extension works. When the client sends a request with no `pos`: * MSC3575 returns all device lists updates since the last request from the device that asked for device lists (this works similarly to to-device message handling), * MSC4186 returns no device lists updates, as it only returns changes since the provided `pos` (which is `null` in this case); this is in line with sync v2. Therefore, with MSC4186, the device list cache must be marked as to be re-downloaded if the `since` token is `None`, otherwise it's easy to miss device lists updates that happened between the previous request and the new “initial” request.
c0bb278
to
781d3d0
Compare
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.
There are still some nits left, but they are trivial so gonna approve ahead of time.
Thanks for taking the time to write a test for this.
See matrix-org/matrix-rust-sdk#3965 for more information. Requires `Extension.onRequest` to be `async`.
Closes #3959.
There is a non-negligible difference MSC3575 and MSC4186 in how the
e2ee
extension works. When the client sends a request with nopos
:MSC3575 returns all device lists updates since the last request
from the device that asked for device lists (this works similarly to
to-device message handling),
MSC4186 returns no device lists updates, as it only returns changes
since the provided
pos
(which isnull
in this case); this is inline with sync v2.
Therefore, with MSC4186, the device list cache must be marked as to be
re-downloaded if the
since
token isNone
, otherwise it's easy tomiss device lists updates that happened between the previous request and
the new “initial” request.
This patch first off implements
OlmMachine::mark_all_tracked_users_as_dirty
.Next, this patch uses this method inside sliding sync when
pos
isNone
ande2ee
extension is enabled.