-
Notifications
You must be signed in to change notification settings - Fork 240
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
feat(sdk): Remove SlidingSyncRoomInner::inner
#3085
Conversation
This patch removes the need to store and to update the `SlidingSyncRoom::inner` field (of type `v4::SlidingSyncRoom`). Now, we just need to handle the `prev_batch`, which is the only data we care about. Bonus: it reduces the size of the frozen sliding sync room quite much.
02c879a
to
43bed28
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3085 +/- ##
==========================================
+ Coverage 83.71% 83.72% +0.01%
==========================================
Files 224 224
Lines 23497 23478 -19
==========================================
- Hits 19671 19658 -13
+ Misses 3826 3820 -6 ☔ 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.
Look, after two years of pain it's almost dead. Great work.
/// Internal state of `Self`. | ||
state: RwLock<SlidingSyncRoomState>, | ||
|
||
/// The token for back-pagination. | ||
prev_batch: RwLock<Option<String>>, |
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's actually a field in RoomInfo
for this as well:
matrix-rust-sdk/crates/matrix-sdk-base/src/rooms/normal.rs
Lines 777 to 778 in ff89315
/// The prev batch of this room we received during the last sync. | |
pub(crate) last_prev_batch: Option<String>, |
If the field in RoomInfo
makes sense is debatable, but I did want to let you know about it.
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.
Hmm interesting. I'll update this PR to use the Roominfo::last_prev_batch
field instead. It seems more relevant. Thanks!
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.
Feel free to move this to a separate PR, there has been talk that this should not be part of the RoomInfo
, though I can't remember the specific complaint anymore.
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.
Done here #3092.
This patch removes the need to store and to update the
SlidingSyncRoom::inner
field (of typev4::SlidingSyncRoom
). Now,we just need to handle the
prev_batch
, which is the only data we careabout.
Bonus: it reduces the size of the frozen sliding sync room quite much.
SlidingSyncRoom
tech debt #3079