From 4b2abea1a8b06008834a2e91711950b3c3fceab4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Feb 2022 18:24:23 +0000 Subject: [PATCH 1/3] Fix M_WRONG_ROOM_KEYS_VERSION error not including `current_version` field Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- synapse/api/errors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/synapse/api/errors.py b/synapse/api/errors.py index 85302163dad9..e92db29f6dc6 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py @@ -406,6 +406,9 @@ def __init__(self, current_version: str): super().__init__(403, "Wrong room_keys version", Codes.WRONG_ROOM_KEYS_VERSION) self.current_version = current_version + def error_dict(self) -> "JsonDict": + return cs_error(self.msg, self.errcode, current_version=self.current_version) + class UnsupportedRoomVersionError(SynapseError): """The client's request to create a room used a room version that the server does From b1120fb4caf1efeb1033031f3c0a77287266c7c7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Feb 2022 18:27:53 +0000 Subject: [PATCH 2/3] Add newsfragment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- changelog.d/11988.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/11988.bugfix diff --git a/changelog.d/11988.bugfix b/changelog.d/11988.bugfix new file mode 100644 index 000000000000..a13b6a4df575 --- /dev/null +++ b/changelog.d/11988.bugfix @@ -0,0 +1 @@ +Fix M_WRONG_ROOM_KEYS_VERSION errors not including the specced current_version field. From 8a3513f9322c64be2bf1cf97e5f68e30a8b10d2c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Feb 2022 18:45:15 +0000 Subject: [PATCH 3/3] Update changelog.d/11988.bugfix Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> --- changelog.d/11988.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/11988.bugfix b/changelog.d/11988.bugfix index a13b6a4df575..ced10d0c8156 100644 --- a/changelog.d/11988.bugfix +++ b/changelog.d/11988.bugfix @@ -1 +1 @@ -Fix M_WRONG_ROOM_KEYS_VERSION errors not including the specced current_version field. +Fix a long-standing bug where `M_WRONG_ROOM_KEYS_VERSION` errors would not include the specced `current_version` field.