-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
@fuzzmz : please could you add a note for the changelog as per https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#changelog ? |
@richvdh done. |
db65a15
to
60a68df
Compare
Sorry for making this harder than it should be. Rebased on the latest version of develop, squashed all the changes and signed-off. |
|
||
Serban Constantin <serban.constantin at gmail dot com> | ||
* Small bug fix |
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.
That file is in general for people who contributed a feature. I would say, that your "Small bug fix" does not count.
If it would it should contain all contributors.
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 the CONTRIBUTING.rst file says, anyone making a PR is welcome to add themselves, for any contribution. It's not the size that that matters...
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.
Good to know. Then nvm
synapse/rest/client/v1/directory.py
Outdated
@@ -159,7 +159,7 @@ def __init__(self, hs): | |||
def on_GET(self, request, room_id): | |||
room = yield self.store.get_room(room_id) | |||
if room is None: | |||
raise SynapseError(400, "Unknown room") | |||
raise SynapseError(404, "Unknown 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.
ok this looks good to me, but the error code will still be M_UNKNOWN
. Really it ought to be M_NOT_FOUND
as per https://matrix.org/docs/spec/client_server/unstable.html#get-matrix-client-r0-directory-list-room-roomid.
I think that there's a NotFoundError
or something you can raise instead?
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.
Fixed this in the latest commit to raise NotFoundError
instead of the generic one.
The fact that there aren't any tests is no doubt how the bug happened in the first place. I've raised matrix-org/sytest#476 :/ |
@matrixbot test this please |
now you need to |
Per the Client-Server API[0] we should return `M_NOT_FOUND` if the room isn't found instead of generic SynapseError. This ensures that /directory/list API returns 404 for room not found instead of 400. [0]: https://matrix.org/docs/spec/client_server/unstable.html#get-matrix-client-r0-directory-list-room-roomid Signed-off-by: Serban Constantin <[email protected]>
edc737c
to
70af98e
Compare
@matrixbot: test this please |
Fixes #2952
Couldn't find any tests related to this though.