-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add test to make sure /messages
behaves as expected for non-existent room_id
's
#369
Add test to make sure /messages
behaves as expected for non-existent room_id
's
#369
Conversation
…room_ids Tests for Synapse regression fix: matrix-org/synapse#12683 Issue: matrix-org/synapse#12678
@@ -59,6 +59,25 @@ func TestSendAndFetchMessage(t *testing.T) { | |||
}) | |||
} | |||
|
|||
// With a non-existent room_id, GET /rooms/:room_id/messages returns 403 | |||
// forbidden ("You aren't a member of the room"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in the spec,
403 | You aren’t a member of the room.
-- https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidmessages
…12683) Fix #12678 Complement test added: matrix-org/complement#369 **Before:** 500 internal server error **After:** According to the [spec](https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidmessages), calling `/messages` against a non-existent `room_id` should throw a 403 forbidden (since you're not part of the room). This also matches the behavior before #12370 which regressed Synapse to the 500 behavior. ```json { "errcode": "M_FORBIDDEN", "error": "User @test:my.synapse.server not in room !dne:my.synapse.server, and room previews are disabled" } ```
Silly github auto-closed the PR when I merged the Dendrite fix :S |
…does-not-exist-room-id
Thanks for the review and merge @kegsay! Cool to see the Dendrite fix for this to all align as well! 🦏 |
Add test to make sure
/messages
behaves as expected for non-existentroom_id
'sTests for Synapse regression fix: matrix-org/synapse#12683
Issue: matrix-org/synapse#12678