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

room preview: allow passing through a list of servers to discover a room with MSC3266 #3407

Merged
merged 2 commits into from
May 16, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented May 13, 2024

Fixes #3395.

@bnjbvr bnjbvr requested a review from a team as a code owner May 13, 2024 15:06
@bnjbvr bnjbvr requested review from poljar and removed request for a team May 13, 2024 15:06
bindings/matrix-sdk-ffi/src/client.rs Outdated Show resolved Hide resolved
@bnjbvr
Copy link
Member Author

bnjbvr commented May 13, 2024

Note to self: since the via parameters are only meaningful when using a room id, rework so that there are two methods:

  • get_room_preview_with_id(room_id, via)
  • get_room_preview_with_alias(room_alias)

And ditto for the join_room methods.

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 82.96%. Comparing base (83427b3) to head (c9c4329).
Report is 7 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk/src/client/mod.rs 66.66% 2 Missing ⚠️
crates/matrix-sdk/src/room_preview.rs 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3407      +/-   ##
==========================================
- Coverage   82.96%   82.96%   -0.01%     
==========================================
  Files         245      245              
  Lines       24901    24905       +4     
==========================================
+ Hits        20660    20663       +3     
- Misses       4241     4242       +1     

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

@poljar poljar removed their request for review May 14, 2024 10:12
@bnjbvr bnjbvr requested a review from Hywan May 14, 2024 16:26
@bnjbvr
Copy link
Member Author

bnjbvr commented May 14, 2024

Requesting another round of review because there's been some dramatic changes:

  • passing a via list of servers to help resolving is only useful when there's a RoomId, not a RoomAliasId; as a result, the FFI method has been split into two methods.
  • I suspect MSC3266's implementation will work better if we pass directly a room alias id, instead of 1. resolving the room alias to a room id, 2. and then pass the room alias id. The reasoning is the same as above: if we passed it only a room id, then it would fail because the via list would be empty; if we pass it the RoomAliasId directly, it might resolve it server-side. Your guess as good as mine.
    • this required a bit of a rewrite of the get_room_preview so it takes a RoomOrAliasId parameter, and a few matches here and there to make it work as intended. I didn't add a changelog entry because there hasn't been any release since the introduction of get_room_preview, as far as I can tell.

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.

I like the split and I believe it brings clarity, thanks!

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.

approving

@bnjbvr bnjbvr merged commit 7ae0bce into main May 16, 2024
35 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/via-parameters branch May 16, 2024 08:58
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.

Room previews using the room summary API from MSC3266 fail for remote rooms
2 participants