Skip to content
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

Ensure that we request the correct state event for the service members to work correctly #4407

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

poljar
Copy link
Contributor

@poljar poljar commented Dec 12, 2024

We forgot that under sliding sync we won't have access to all state events, which meant that #4335 never got working.

The first commit adds the relevant event to the required state for the UI crate.

The second commit fixes another edge case in the case where we homeserver does provide a room summary containing service members in the heroes and thus in the joined members count.

@poljar poljar requested a review from a team as a code owner December 12, 2024 09:42
@poljar poljar requested review from Hywan and a team and removed request for a team December 12, 2024 09:42
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Thanks!

crates/matrix-sdk-base/src/rooms/normal.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-base/src/rooms/normal.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.27%. Comparing base (3356e0c) to head (92bc5e6).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4407      +/-   ##
==========================================
- Coverage   85.29%   85.27%   -0.02%     
==========================================
  Files         282      282              
  Lines       31178    31186       +8     
==========================================
+ Hits        26592    26594       +2     
- Misses       4586     4592       +6     

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

@poljar poljar force-pushed the poljar/fix-service-members-sliding-sync branch from bb0baf0 to 9c1d950 Compare December 12, 2024 12:26
@poljar poljar enabled auto-merge (rebase) December 12, 2024 12:26
@poljar poljar disabled auto-merge December 12, 2024 12:27
This state event allows us to correctly calculate the room display name
according to MSC4171.

MSC: matrix-org/matrix-spec-proposals#4171
…ned members

This patch fixes an edge case where the member is alone in the room with
a service member. We already subtracted the number of service members
in the case we calculated the room summary ourselves, but we did not do
so when the server provided the room summary.

This lead to the room, instead of being called `Empty`, being called
`Foo and N others`.
@poljar poljar merged commit 54bd1d7 into main Dec 12, 2024
40 checks passed
@poljar poljar deleted the poljar/fix-service-members-sliding-sync branch December 12, 2024 13:44
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.

2 participants