-
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,base,ui,ffi): Continue to remove dead code in SlidingSyncRoom
#3084
Merged
Hywan
merged 3 commits into
matrix-org:main
from
Hywan:fix-sdk-sliding-sync-room-unused-methods
Feb 1, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are we certain that this is not needed? The proxy calculates the room name for us even before we have all the members or events, i.e. it does what
display_name()
does for us.I see that we're storing whatever the proxy sends to us as the
m.room.name
event in theRoomInfo
since #2032.But that PR seems to be questionable at best. Though the PR should mean that these two method do contain the same info.
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.
Oops, auto-merge strikes again 😨
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.
The SS room name is synced with the room and room info during the sync process. So yeah, this is not needed to keep it in SS room 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.
And to reply concretely to your mesasge, normally
display_name
returns early ifRoomInfo
contains a name,matrix-rust-sdk/crates/matrix-sdk-base/src/rooms/normal.rs
Lines 568 to 575 in 40e0066
Also, we have this test that ensures the behaviour at the sliding sync level,
matrix-rust-sdk/crates/matrix-sdk-base/src/sliding_sync.rs
Lines 1212 to 1232 in 40e0066
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 know what
display_name()
does, it follows the spec: https://spec.matrix.org/unstable/client-server-api/#calculating-the-display-name-for-a-room.What I'm complaining about is that we put something that isn't a
m.room.name
event content into the field that always should contain am.room.name
event content.The thing that the SS proxy returns is not a
m.room.name
event, it's the result of the calculation I linked previously done by the proxy.Incidentally this thing works, because we created a fake
m.room.name
event and put it in the same field, the spec tells you to take this field verbatim. The problem is that this data, while also being a string, is semantically very different.This might now contain the field "Tom, Dick, and Harry" for a three person room, but this string should be localized and we lost any way of doing and detecting this case because we pretended that it's actually an
m.room.name
event that contains "Tom, Dick, and Harry".I should probably post this complaint on the PR instead or just open a new issue. I find such hacks that make things quickly work, but mangle with the correctness and make future features harder to implement, for example like the localization of room display names, the bane of our existence.