Return better error when client tries to join non-existent room #1604
Labels
No labels
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1604
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ezera/continuwuity:ezera/joining-nonexistent-room-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously: #1579
This pull request changes the error returned by the server when the user attempts to join a non-existent room (see #1443). Previously, the server returned error 500. Now, we return error 404, with a generic error message, which is closer to what Synapse does (as stated in #1443).
I considered returning
because I agree that it would make sense to prevent someone from enumerating which rooms exist. However, I settled on 404, because I thought it would make sense to mimic Synapse for the sake of client compatibility. Please let me know if you disagree.
I also defined a new
err!macro arm. I wasn't sure that was the best idea, but there didn't seem to be an existing arm that fit for returning this kind of error.I ran the tests locally, and everything passed, but I haven't added a test for this specific case.
Fixes: #1443
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
ezera/joining-nonexistent-room-errorto WIP ezera/joining-nonexistent-room-error1326e33fc5e78afffdc8WIP ezera/joining-nonexistent-room-errorto ezera/joining-nonexistent-room-errore78afffdc8d8e2ad89b7ezera/joining-nonexistent-room-errorto Return better error when client tries to join non-existent roomd8e2ad89b7d4ef7dad92Looks OK to me
Awesome, thank you!
d4ef7dad9259fc1fccb559fc1fccb567d8d72506