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(room_preview): add fallback server names when possible #4357

Merged

Conversation

jmartinesp
Copy link
Contributor

If no server names are provided for the room summary request and the room's server name doesn't match the current user's server name, add the room alias/id server name as a fallback value. This seems to fix room preview through federation, when there is a server name in either the room id or alias.

Also, when getting a summary for a room list item, if it's an invite one, add the server name of the inviter's user id as another possible fallback.

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@jmartinesp jmartinesp requested a review from a team as a code owner November 29, 2024 15:36
@jmartinesp jmartinesp requested review from Hywan and removed request for a team November 29, 2024 15:36
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Left some nits, looks good.

crates/matrix-sdk/src/room_preview.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/room_preview.rs Show resolved Hide resolved
crates/matrix-sdk/src/room_preview.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.10%. Comparing base (685386d) to head (ed4dc67).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4357   +/-   ##
=======================================
  Coverage   85.10%   85.10%           
=======================================
  Files         280      280           
  Lines       30535    30543    +8     
=======================================
+ Hits        25988    25995    +7     
- Misses       4547     4548    +1     

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

@jmartinesp jmartinesp force-pushed the fix/include-server-name-automatically-for-room-preview branch from bf2888e to 0028c93 Compare November 29, 2024 16:21
@jmartinesp jmartinesp enabled auto-merge (rebase) November 29, 2024 16:22
@poljar poljar self-assigned this Nov 30, 2024
…r names

If no server names are provided for the room summary request and the
room's server name doesn't match the current user's server name, add the
room alias/id server name as a fallback value. This seems to fix room
preview through federation.

Also, when getting a summary for a room list item, if it's an invite
one, add the server name of the inviter's user id as another possible
fallback.

Changelog: Use the inviter's server name and the server name from the
room alias as fallback values for the via parameter when requesting the
room summary from the homeserver.
@poljar poljar force-pushed the fix/include-server-name-automatically-for-room-preview branch from 0028c93 to ed4dc67 Compare December 2, 2024 10:22
@jmartinesp jmartinesp merged commit d2fecb6 into main Dec 2, 2024
40 checks passed
@jmartinesp jmartinesp deleted the fix/include-server-name-automatically-for-room-preview branch December 2, 2024 11:11
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