anonymousland-synapse/synapse
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
..
_scripts Add missing type hints to config classes. (#12402) 2022-04-11 12:07:23 -04:00
api Fix incorrect type hint in filtering code. (#12695) 2022-05-10 14:10:22 -04:00
app 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
appservice Update mypy to 0.950 and fix complaints (#12650) 2022-05-06 12:35:20 +00:00
config 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
crypto Bump black and click versions (#12320) 2022-04-05 11:04:28 +01:00
events Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
federation Fix inconsistent spelling of 'M_UNRECOGNIZED'. (#12665) 2022-05-09 20:29:07 +00:00
groups Remove HomeServer.get_datastore() (#12031) 2022-02-23 11:04:02 +00:00
handlers Fix /messages throwing a 500 when querying for non-existent room (#12683) 2022-05-10 23:39:14 -05:00
http Capture the Deferred for request cancellation in _AsyncResource (#12694) 2022-05-10 20:39:05 +01:00
logging Use getClientAddress instead of getClientIP. (#12599) 2022-05-04 14:11:21 -04:00
metrics Update mypy to 0.950 and fix complaints (#12650) 2022-05-06 12:35:20 +00:00
module_api Use ParamSpec in a few places (#12667) 2022-05-09 10:27:39 +00:00
push Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
replication Update replication.md with info on TCP module structure (#12621) 2022-05-09 14:46:43 -07:00
res Fix Jinja templating error when generating thumbnail URLs. (#12510) 2022-04-20 12:03:03 -04:00
rest Fix mypy against latest pillow stubs (#12671) 2022-05-09 10:48:14 +00:00
server_notices Update the server notices user profile in room if changed. (#12115) 2022-04-08 07:51:27 -04:00
spam_checker_api Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
state Refactor EventContext (#12689) 2022-05-10 19:43:13 +00:00
static Display an error page during failure of fallback UIA. (#10561) 2021-08-18 08:13:35 -04:00
storage Fix /messages throwing a 500 when querying for non-existent room (#12683) 2022-05-10 23:39:14 -05:00
streams Generate historic pagination token for /messages when no ?from token provided (#12370) 2022-04-06 11:40:28 +01:00
util Immediately retry any requests that have backed off when a server comes back online. (#12500) 2022-05-10 10:39:54 +01:00
__init__.py Dump setuptools; correct pyproject version number (#12478) 2022-04-20 17:33:20 +01:00
event_auth.py Remove excess condition on knock->leave check (#11900) 2022-02-22 18:35:01 +00:00
notifier.py Immediately retry any requests that have backed off when a server comes back online. (#12500) 2022-05-10 10:39:54 +01:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Add a module API to allow modules to edit push rule actions (#12406) 2022-04-27 13:55:33 +00:00
types.py Make StreamToken and RoomStreamToken methods propagate cancellations (#12366) 2022-04-05 16:56:52 +01:00
visibility.py Optimise backfill calculation (#12522) 2022-04-26 10:27:11 +01:00