This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Attempting to call /messages
on a room that doesn't exist results in a 500
#12678
Labels
A-Messages-Endpoint
/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
X-Regression
Something broke which worked on a previous release
Comments
Ah, new in 1.57 I think |
Here is the traceback:
Before #12370, {
"errcode": "M_FORBIDDEN",
"error": "User @test:my.synapse.server not in room !dne:my.synapse.server, and room previews are disabled"
} |
MadLittleMods
added a commit
that referenced
this issue
May 10, 2022
Fix #12678 Before: 500 internal server error After: When calling `/messages` against a non-existent room_id it should throw a 403 forbidden, see https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidmessages ```json { "errcode": "M_FORBIDDEN", "error": "User @test:my.synapse.server not in room !dne:my.synapse.server, and room previews are disabled" } ```
5 tasks
MadLittleMods
added a commit
to matrix-org/complement
that referenced
this issue
May 10, 2022
…room_ids Tests for Synapse regression fix: matrix-org/synapse#12683 Issue: matrix-org/synapse#12678
MadLittleMods
added a commit
that referenced
this issue
May 11, 2022
…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" } ```
kegsay
added a commit
to matrix-org/complement
that referenced
this issue
May 11, 2022
…t `room_id`'s (#369) * Add test to make sure /messages behaves as expected for non-existent room_ids Tests for Synapse regression fix: matrix-org/synapse#12683 Issue: matrix-org/synapse#12678 * Explain why 403 * Remove dendrite skip Co-authored-by: Kegan Dougal <kegan@matrix.org>
SpiritCroc
pushed a commit
to SpiritCroc/synapse-old
that referenced
this issue
May 12, 2022
Fix matrix-org#12678 Before: 500 internal server error After: When calling `/messages` against a non-existent room_id it should throw a 403 forbidden, see https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidmessages ```json { "errcode": "M_FORBIDDEN", "error": "User @test:my.synapse.server not in room !dne:my.synapse.server, and room previews are disabled" } ```
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Labels
A-Messages-Endpoint
/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
X-Regression
Something broke which worked on a previous release
Description
Requesting messages for a nonsense room id should probably return a 404 or a 403, but instead it just blows up in Sentry with a 500 here: https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/pagination.py#L451
Interestingly the spec only says 200 or 403 (You're not a member of this room) are valid responses.
https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidmessages
Steps to reproduce
Throw this in your javascript console for your element web login
Version information
Beeper's fork of 1.57.1 (haven't gotten to 1.58 yet) but reproduced as well on matrix.org (above)
The text was updated successfully, but these errors were encountered: