Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 54e74f8

Browse files
authored
Fix M_WRONG_ROOM_KEYS_VERSION error not including current_version field (#11988)
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 7812fe9 commit 54e74f8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

changelog.d/11988.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a long-standing bug where `M_WRONG_ROOM_KEYS_VERSION` errors would not include the specced `current_version` field.

synapse/api/errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ def __init__(self, current_version: str):
406406
super().__init__(403, "Wrong room_keys version", Codes.WRONG_ROOM_KEYS_VERSION)
407407
self.current_version = current_version
408408

409+
def error_dict(self) -> "JsonDict":
410+
return cs_error(self.msg, self.errcode, current_version=self.current_version)
411+
409412

410413
class UnsupportedRoomVersionError(SynapseError):
411414
"""The client's request to create a room used a room version that the server does

0 commit comments

Comments
 (0)