Skip to content

feat: MSC 4278 implementation #5014

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

Closed
wants to merge 1 commit into from
Closed

feat: MSC 4278 implementation #5014

wants to merge 1 commit into from

Conversation

Velin92
Copy link
Member

@Velin92 Velin92 commented May 7, 2025

This PR updates Ruma and implements new APIs to use the unstable MSC 4278.

This new global account data setting, will be used by clients to decide what policy to follow in display the media previews in the timeline, and the avatars in invite requests

@Velin92 Velin92 requested a review from a team as a code owner May 7, 2025 16:06
@Velin92 Velin92 requested review from andybalaam and removed request for a team May 7, 2025 16:06
Comment on lines +956 to +954
// TODO: I think I should reset all the storage and perform a new local sync
// here but I don't know how
Copy link
Member Author

Choose a reason for hiding this comment

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

Not really sure what to do here

// TODO: I think I should reset all the storage and perform a new local sync
// here but I don't know how
Copy link
Member Author

Choose a reason for hiding this comment

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

Not really sure what to do here

Copy link
Member

Choose a reason for hiding this comment

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

I was actually looking at this recently and was surprised to see the store not getting updated when we set some account data. @poljar is there a way to tell the store that a piece of account data has been changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well the assumption is that a sync is running. Or maybe I'm misunderstanding what a local sync would be?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just looked at the the ignore_user and unignore_user function which has the exact same comment. So I assume this is a known issue maybe? I imagine that since the sync might take some time this means that if we change the value and immediately check the account data again, it won't be updated right?
And if so how long may it take to be update, are we talking about seconds or milliseconds?
Since this may affect how we design the UI.

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as a sync takes, you can subscribe to listen to account data events. There's actually a PR in flight to add exactly this to the bindings: #4994.

I suppose you'll have to subscribe to this anyways, in case the value gets updated on another device.

Copy link
Member Author

Choose a reason for hiding this comment

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

nice this would be very useful!

Copy link

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.

Project coverage is 85.78%. Comparing base (fc071ba) to head (60a2d20).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/account.rs 0.00% 34 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5014      +/-   ##
==========================================
- Coverage   85.86%   85.78%   -0.08%     
==========================================
  Files         325      325              
  Lines       35853    35887      +34     
==========================================
+ Hits        30785    30787       +2     
- Misses       5068     5100      +32     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Velin92 Velin92 force-pushed the mauroromito/msc4278 branch from ad0b822 to 9feea1c Compare May 7, 2025 16:23
Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

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

This looks great - marking as "request changes" so it pings me when we figure out the remaining questions and you re-request review.

// TODO: I think I should reset all the storage and perform a new local sync
// here but I don't know how
Copy link
Member

Choose a reason for hiding this comment

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

I was actually looking at this recently and was surprised to see the store not getting updated when we set some account data. @poljar is there a way to tell the store that a piece of account data has been changed?

@Velin92 Velin92 force-pushed the mauroromito/msc4278 branch from 9feea1c to 4f4c52e Compare May 8, 2025 10:40
@Velin92
Copy link
Member Author

Velin92 commented May 9, 2025

I'll close this PR then in favour of this one: #5017 that only updates Ruma, then I'll open another PR based on #4994

@Velin92 Velin92 closed this May 9, 2025
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.

4 participants