forked-synapse/synapse/handlers
Eric Eastwood 84facf769e
Fix /messages throwing a 500 when querying for non-existent room (#12683)
Fix https://github.com/matrix-org/synapse/issues/12678

Complement test added:  https://github.com/matrix-org/complement/pull/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 https://github.com/matrix-org/synapse/pull/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"
}
```
2022-05-10 23:39:14 -05:00
..
ui_auth Fix typo in some instances of enable_registration_token_3pid_bypass. (#12639) 2022-05-05 07:11:52 -04:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
account_data.py Add a module callback to react to account data changes (#12327) 2022-04-01 11:22:48 +02:00
account_validity.py Implement cancellation support/protection for module callbacks (#12568) 2022-05-09 12:31:14 +01:00
account.py Optionally include account validity in MSC3720 account status responses (#12266) 2022-03-24 11:19:41 +01:00
admin.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
appservice.py Add the notify_appservices_from_worker configuration option (superseding notify_appservices) to allow a generic worker to be designated as the worker to send traffic to Application Services. (#12452) 2022-05-06 11:43:53 +01:00
auth.py Implement cancellation support/protection for module callbacks (#12568) 2022-05-09 12:31:14 +01:00
cas.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
deactivate_account.py Add third_party module callbacks to check if a user can delete a room and deactivate a user (#12028) 2022-03-09 18:23:57 +00:00
device.py Mark remote device list updates as already handled (#12557) 2022-04-26 17:07:21 +01:00
devicemessage.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
directory.py Rename various ApplicationServices interested methods (#11915) 2022-03-03 18:14:09 +00:00
e2e_keys.py Refactor and convert Linearizer to async (#12357) 2022-04-05 15:43:52 +01:00
e2e_room_keys.py Refactor and convert Linearizer to async (#12357) 2022-04-05 15:43:52 +01:00
event_auth.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
events.py remove constantly lib use and switch to enums. (#12624) 2022-05-04 11:26:11 +00:00
federation_event.py Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
federation.py Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
groups_local.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
identity.py Use getClientAddress instead of getClientIP. (#12599) 2022-05-04 14:11:21 -04:00
initial_sync.py Use private instead of hidden in MSC2285 related code. (#12635) 2022-05-05 12:31:25 +00:00
message.py Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
oidc.py Remove unused # type: ignores (#12531) 2022-04-27 14:03:44 +01:00
pagination.py Fix /messages throwing a 500 when querying for non-existent room (#12683) 2022-05-10 23:39:14 -05:00
password_policy.py Use direct references for some configuration variables (part 3) (#10885) 2021-09-23 07:13:34 -04:00
presence.py Prevent memory leak from reoccurring when presence is disabled. (#12656) 2022-05-06 16:41:57 +00:00
profile.py Always allow the empty string as an avatar_url. (#12261) 2022-03-25 13:28:42 +00:00
push_rules.py Add a module API to allow modules to edit push rule actions (#12406) 2022-04-27 13:55:33 +00:00
read_marker.py Refactor and convert Linearizer to async (#12357) 2022-04-05 15:43:52 +01:00
receipts.py Use private instead of hidden in MSC2285 related code. (#12635) 2022-05-05 12:31:25 +00:00
register.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
relations.py Edits/annotations should not have any bundled aggregations calculated. (#12633) 2022-05-05 08:15:12 -04:00
room_batch.py Optimise backfill calculation (#12522) 2022-04-26 10:27:11 +01:00
room_list.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
room_member_worker.py Implement knock feature (#6739) 2021-06-09 19:39:51 +01:00
room_member.py Refactor and convert Linearizer to async (#12357) 2022-04-05 15:43:52 +01:00
room_summary.py Support MSC3266 room summaries over federation (#11507) 2022-05-05 15:25:00 +01:00
room.py Convert stringy power levels to integers on room upgrade (#12657) 2022-05-07 13:37:29 +01:00
saml.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
search.py Remove unused # type: ignores (#12531) 2022-04-27 14:03:44 +01:00
send_email.py Remove unnecessary ignores due to Twisted upgrade. (#11939) 2022-02-08 09:15:59 -05:00
set_password.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
sso.py Use getClientAddress instead of getClientIP. (#12599) 2022-05-04 14:11:21 -04:00
state_deltas.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
stats.py Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
sync.py Implement changes to MSC2285 (hidden read receipts) (#12168) 2022-05-04 11:59:22 -04:00
typing.py Improve code documentation for the typing stream over replication. (#12211) 2022-03-11 14:00:15 +00:00
user_directory.py Add the update_user_directory_from_worker configuration option (superseding update_user_directory) to allow a generic worker to be designated as the worker to update the user directory. (#12654) 2022-05-10 11:08:45 +01:00