Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

invite_room_state is required by Synapse in /_matrix/federation/v2/invite/, contrary to spec #10800

Closed
DMRobertson opened this issue Sep 10, 2021 · 1 comment · Fixed by #14083
Labels
A-Spec-Compliance places where synapse does not conform to the spec A-Validation 500 (mostly) errors due to lack of event/parameter validation P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@DMRobertson
Copy link
Contributor

When writing a complement test I tried to have one homeserver invite another. I sent a request to Synapse and omitted invite_room_state, because both stable and unstable specs marked them as optional. Synapse fell over with a 500 error.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 446, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.8/site-packages/synapse/federation/transport/server/_base.py", line 303, in new_func
    response = await func(
  File "/usr/local/lib/python3.8/site-packages/synapse/federation/transport/server/federation.py", line 404, in on_PUT
    invite_room_state = content["invite_room_state"]

Maybe this is just a mistaken assumption made at the rest layer, and it's fine in the handler? If so, I'd guess we want to replace this with a `.get("invite_room_state", []). That's an untested hypothesis though!

@DMRobertson DMRobertson added A-Spec-Compliance places where synapse does not conform to the spec S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches labels Sep 10, 2021
@clokep
Copy link
Member

clokep commented Sep 13, 2021

Maybe this is just a mistaken assumption made at the rest layer, and it's fine in the handler? If so, I'd guess we want to replace this with a `.get("invite_room_state", []). That's an untested hypothesis though!

This seems like the right fix to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec A-Validation 500 (mostly) errors due to lack of event/parameter validation P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants