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(ffi): match the right status code in Client::is_room_alias_available #4235

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

jmartinesp
Copy link
Contributor

Previously I was matching a different error state, so it turns out the code was failing 🫠 .

  • Public API changes documented in changelogs (optional)

Signed-off-by:

@jmartinesp jmartinesp requested a review from a team as a code owner November 8, 2024 08:42
@jmartinesp jmartinesp requested review from bnjbvr and removed request for a team November 8, 2024 08:42
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

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

Project coverage is 84.86%. Comparing base (46232ee) to head (a273022).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/test_utils/mocks.rs 75.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4235      +/-   ##
==========================================
- Coverage   84.89%   84.86%   -0.03%     
==========================================
  Files         274      274              
  Lines       29689    29712      +23     
==========================================
+ Hits        25204    25215      +11     
- Misses       4485     4497      +12     

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

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.

How come we don't need to change a test? Could it be that we don't have one? 😨

Anyways, would be nice to add it now.

@poljar poljar removed the request for review from bnjbvr November 8, 2024 09:01
@jmartinesp
Copy link
Contributor Author

Will FFI layer tests run in the CI? If so, I'll add one, I thought they didn't 🫤 .

@poljar
Copy link
Contributor

poljar commented Nov 8, 2024

Will FFI layer tests run in the CI? If so, I'll add one, I thought they didn't 🫤 .

Doesn't seem like it.

I think that we should either enable them or move the bulk of the logic to the main crate and add a test there. Fixing a bug without a test sounds worse to me.

@jmartinesp jmartinesp force-pushed the fix/client-is-room-alias-available-404 branch from fb29192 to 07ab725 Compare November 8, 2024 10:39
@jmartinesp
Copy link
Contributor Author

Moved the fn to the SDK crate and added some tests, now the FFI layer only maps some values and calls the inner function.

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.

Nice, thanks for adding the test.

Small reminder, please use the MatrixMockServer for new tests in the future.

@jmartinesp jmartinesp force-pushed the fix/client-is-room-alias-available-404 branch from 07ab725 to cd62cc6 Compare November 8, 2024 11:21
@jmartinesp
Copy link
Contributor Author

I implemented a new endpoint in MatrixMockServer for this, I'll merge the PR as soon as the CI is finished.

@jmartinesp jmartinesp enabled auto-merge (rebase) November 8, 2024 11:21
@jmartinesp jmartinesp force-pushed the fix/client-is-room-alias-available-404 branch from cd62cc6 to a273022 Compare November 8, 2024 11:22
@jmartinesp jmartinesp merged commit ab61077 into main Nov 8, 2024
39 checks passed
@jmartinesp jmartinesp deleted the fix/client-is-room-alias-available-404 branch November 8, 2024 11: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