From baf8948eb5b3be04f06bba0fce87153834bda16f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 24 Feb 2019 21:53:50 -0700 Subject: [PATCH 1/2] Describe M_UNSUPPORTED_ROOM_VERSION on invite and createRoom endpoints Spec for MSC1866: https://github.com/matrix-org/matrix-doc/pull/1866 --- api/client-server/create_room.yaml | 6 ++++++ api/client-server/inviting.yaml | 14 ++++++++++++++ .../client_server/newsfragments/1903.feature | 1 + 3 files changed, 21 insertions(+) create mode 100644 changelogs/client_server/newsfragments/1903.feature diff --git a/api/client-server/create_room.yaml b/api/client-server/create_room.yaml index d361d9738..bce61aad3 100644 --- a/api/client-server/create_room.yaml +++ b/api/client-server/create_room.yaml @@ -244,6 +244,12 @@ paths: invalid: for example, the user's ``power_level`` is set below that necessary to set the room name (``errcode`` set to ``M_INVALID_ROOM_STATE``). + + - The homeserver doesn't support the requested room version, or + one or more users being invited to the new room are residents + of a homeserver which does not support the requested room version. + The ``errcode`` will be ``M_UNSUPPORTED_ROOM_VERSION`` in these + cases. schema: "$ref": "definitions/errors/error.yaml" tags: diff --git a/api/client-server/inviting.yaml b/api/client-server/inviting.yaml index f312d5ceb..dfa66b9b0 100644 --- a/api/client-server/inviting.yaml +++ b/api/client-server/inviting.yaml @@ -82,6 +82,20 @@ paths: } schema: type: object + 400: + description: |- + + The request is invalid. A meaningful ``errcode`` and description + error text will be returned. Example reasons for rejection include: + + - The request body is malformed (``errcode`` set to ``M_BAD_JSON`` + or ``M_NOT_JSON``). + + - One or more users being invited to the room are residents of a + homeserver which does not support the requested room version. The + ``errcode`` will be ``M_UNSUPPORTED_ROOM_VERSION`` in these cases. + schema: + "$ref": "definitions/errors/error.yaml" 403: description: |- You do not have permission to invite the user to the room. A meaningful ``errcode`` and description error text will be returned. Example reasons for rejections are: diff --git a/changelogs/client_server/newsfragments/1903.feature b/changelogs/client_server/newsfragments/1903.feature new file mode 100644 index 000000000..1c64d826e --- /dev/null +++ b/changelogs/client_server/newsfragments/1903.feature @@ -0,0 +1 @@ +Emit ``M_UNSUPPORTED_ROOM_VERSION`` error codes where applicable on ``/createRoom`` and ``/invite`` APIs. From adb721bc0b101bcf458a17275792eec20fe96e63 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 24 Feb 2019 21:55:57 -0700 Subject: [PATCH 2/2] Fix unrelated changelog entry's RST representation --- changelogs/client_server/newsfragments/1874.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/client_server/newsfragments/1874.feature b/changelogs/client_server/newsfragments/1874.feature index 03b891e25..bdab54644 100644 --- a/changelogs/client_server/newsfragments/1874.feature +++ b/changelogs/client_server/newsfragments/1874.feature @@ -1 +1 @@ -Add `M_RESOURCE_LIMIT_EXCEEDED` as an error code for when homeservers exceed limits imposed on them. +Add ``M_RESOURCE_LIMIT_EXCEEDED`` as an error code for when homeservers exceed limits imposed on them.