Fix M_WRONG_ROOM_KEYS_VERSION error not including current_version field (#11988)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2022-02-14 19:28:00 +00:00 committed by GitHub
parent 7812fe9edd
commit 54e74f8bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

1
changelog.d/11988.bugfix Normal file
View File

@ -0,0 +1 @@
Fix a long-standing bug where `M_WRONG_ROOM_KEYS_VERSION` errors would not include the specced `current_version` field.

View File

@ -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