Skip to content

feat(room_list): make RoomListService updates subscriptions non-destructively#6652

Open
Johennes wants to merge 6 commits into
matrix-org:mainfrom
Johennes:johannes/resubscribe-rooms
Open

feat(room_list): make RoomListService updates subscriptions non-destructively#6652
Johennes wants to merge 6 commits into
matrix-org:mainfrom
Johennes:johannes/resubscribe-rooms

Conversation

@Johennes

@Johennes Johennes commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

With my Filament hat on.

Fixes: #6620

  • I've documented the public API changes in the appropriate changelog files
    (see Writing changelog entries).
  • This PR was made with the help of AI.

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.19048% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.99%. Comparing base (306b00e) to head (b7a8dca).
⚠️ Report is 220 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/sliding_sync/mod.rs 96.15% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6652      +/-   ##
==========================================
+ Coverage   89.94%   89.99%   +0.04%     
==========================================
  Files         382      382              
  Lines      108012   108112     +100     
  Branches   108012   108112     +100     
==========================================
+ Hits        97152    97295     +143     
+ Misses       7188     7154      -34     
+ Partials     3672     3663       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment on lines 178 to 187
/// Replace all subscriptions to rooms by other ones.
///
/// If the associated `Room`s exist, they will be marked as members are
/// missing, so that it ensures to re-fetch all members.
pub fn clear_and_subscribe_to_rooms(
&self,
room_ids: &[&RoomId],
settings: Option<http::request::RoomSubscription>,
cancel_in_flight_request: bool,
) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hywan I'm curious if this is along the lines of what you had in mind in #6620? I wonder if this should rather be a separate method?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I had in mind was to change the current methods or add methods on RoomListService instead of changing what we have on the SlidingSync API.

Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doing it exclusively on the RoomListService level is tricky because the subscriptions are only known and locked in SlidingSync. I added a new method there now which I think is cleaner than my previous attempt of modifying the existing method.

@codspeed-hq

codspeed-hq Bot commented Jun 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing Johennes:johannes/resubscribe-rooms (b7a8dca) with main (567463d)

Open in CodSpeed

@Hywan Hywan self-requested a review June 9, 2026 08:42
@Johennes Johennes force-pushed the johannes/resubscribe-rooms branch from 09183ba to 8c866a4 Compare June 22, 2026 18:59
@Johennes Johennes changed the title fix(sliding_sync): avoid resubscribing existing subscriptions feat(room_list): make RoomListService updates subscriptions non-destructively Jun 22, 2026
@Johennes Johennes force-pushed the johannes/resubscribe-rooms branch from 8c866a4 to 81d3130 Compare June 22, 2026 19:01
…uctively

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
@Johennes Johennes force-pushed the johannes/resubscribe-rooms branch from 81d3130 to 7e789cc Compare June 22, 2026 19:02
@Johennes Johennes marked this pull request as ready for review June 22, 2026 19:07
@Johennes Johennes requested a review from a team as a code owner June 22, 2026 19:07

@Hywan Hywan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Almost there!

Comment thread crates/matrix-sdk/src/sliding_sync/mod.rs Outdated
Comment thread crates/matrix-sdk/src/sliding_sync/mod.rs Outdated
Comment thread crates/matrix-sdk/src/sliding_sync/mod.rs Outdated
Johennes added 2 commits June 23, 2026 20:08
…n-destructively

Remove leftover print

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
…n-destructively

Extend doc comment

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
@Johennes Johennes requested a review from Hywan June 23, 2026 18:26
Johennes added 2 commits June 25, 2026 20:46
…n-destructively

Switch to retain

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
…n-destructively

Highlight that members won't be resynced

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
@Johennes Johennes requested a review from Hywan June 25, 2026 18:50
…n-destructively

Reformat

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RoomListService::subscribe_to_rooms behaviour when resubscribing to the same rooms

2 participants