diff --git a/changelog.d/11988.bugfix b/changelog.d/11988.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..ced10d0c8156f7f0da968f66ac9e01371a00a390 --- /dev/null +++ b/changelog.d/11988.bugfix @@ -0,0 +1 @@ +Fix a long-standing bug where `M_WRONG_ROOM_KEYS_VERSION` errors would not include the specced `current_version` field. diff --git a/synapse/api/errors.py b/synapse/api/errors.py index 85302163dad945ae6016645fb6f663ae4df5b65c..e92db29f6dc6a65a0e05ca9fc62e409773b34b6c 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py @@ -406,6 +406,9 @@ class RoomKeysVersionError(SynapseError): 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