matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.8k stars 2.13k forks source link

Synapse accepts optional unspecced `servers` field in `PUT directory/room/{roomAlias}` #14177

Open DMRobertson opened 1 year ago

DMRobertson commented 1 year ago

Spec: https://spec.matrix.org/v1.4/client-server-api/#put_matrixclientv3directoryroomroomalias

https://github.com/matrix-org/synapse/blob/6b99a66fe0260682fa95a0b19d3bee19c1e48876/synapse/rest/client/directory.py#L74-L89

Forwarded to here https://github.com/matrix-org/synapse/blob/1a209efdb2a6c51e52dd277de7581099852877ae/synapse/handlers/directory.py#L173 and to here https://github.com/matrix-org/synapse/blob/1a209efdb2a6c51e52dd277de7581099852877ae/synapse/handlers/directory.py#L93-L95 and eventually written to the database here https://github.com/matrix-org/synapse/blob/3e0536cd2afb5a640619bd872fc27b068ec3eb9b/synapse/storage/databases/main/directory.py#L112-L117

DMRobertson commented 1 year ago

Should be easy enough to drop this: we can simply ignore the field.

DMRobertson commented 1 year ago

But first we should check to see if it's in use in a meaningful way (i.e. in a way that differs to what servers=None would provide).