matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Inviting to an unsupported room version return `M_BAD_JSON` instead of `M_UNSUPPORTED_ROOM_VERSION` #1878

Closed clokep closed 3 years ago

clokep commented 3 years ago

Background information

This was tested against dendrite.matrix.org

Description

Sending an invite to a Dendrite instance from a Synapse instance with an experimental room version fails (as expected), but uses the incorrect error code (M_BAD_JSON instead of M_UNSUPPORTED_ROOM_VERSION).

Steps to reproduce

image

Dendrite returns M_BAD_JSON.

image

Expected results

Dendrite returns an error like:

{"errcode":"M_UNSUPPORTED_ROOM_VERSION","error":"Homeserver does not support this room version"}

This helps client give an actionable response to the user.

meenal06 commented 3 years ago

Hey @kegsay Can I work on this?