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

fix(pinned_events): get pinned event ids from the HS as fallback #4205

Merged

Conversation

jmartinesp
Copy link
Contributor

When the required state of a room doesn't contain pinned events info for some reason, try using the /state endpoint from the HS to get this data instead.

This should take care of a bug that caused pinned events to be incorrectly removed when the new pinned event ids list was based on an empty one if the required state of the room didn't contain any pinned events info

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@jmartinesp jmartinesp requested a review from a team as a code owner November 4, 2024 12:28
@jmartinesp jmartinesp requested review from Hywan and removed request for a team November 4, 2024 12:28
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.90%. Comparing base (494532d) to head (72a0ea6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/room/mod.rs 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4205      +/-   ##
==========================================
+ Coverage   84.87%   84.90%   +0.02%     
==========================================
  Files         272      272              
  Lines       29125    29143      +18     
==========================================
+ Hits        24720    24744      +24     
+ Misses       4405     4399       -6     

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

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Good job. Left one question about get_state_events_for_key.

crates/matrix-sdk-ui/src/timeline/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/room/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

LGTM if the tests are passing, thanks!

@jmartinesp
Copy link
Contributor Author

I had to fix the tests separately 😅 . Will merge once the tests are green.

…n't contain it

This should take care of a bug that caused pinned events to be incorrectly removed when the new pinned event ids list was based on an empty one if the required state of the room didn't contain any pinned events info
@jmartinesp jmartinesp force-pushed the fix/get-pinned-events-from-hs-if-not-found-in-sync branch from 7e82a24 to 72a0ea6 Compare November 4, 2024 15:21
@jmartinesp jmartinesp enabled auto-merge (rebase) November 4, 2024 15:21
@jmartinesp jmartinesp merged commit ee25243 into main Nov 4, 2024
39 checks passed
@jmartinesp jmartinesp deleted the fix/get-pinned-events-from-hs-if-not-found-in-sync branch November 4, 2024 15:36
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