mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Add key backup tests (#3071)
Also slightly refactors the functions and methods to rely less on the req/res pattern we had for polylith. Returns `M_WRONG_ROOM_KEYS_VERSION` for some endpoints as per the spec
This commit is contained in:
parent
6b47cf0f6a
commit
9e9617ff84
5 changed files with 498 additions and 147 deletions
|
@ -171,6 +171,23 @@ func LeaveServerNoticeError() *MatrixError {
|
|||
}
|
||||
}
|
||||
|
||||
// ErrRoomKeysVersion is an error returned by `PUT /room_keys/keys`
|
||||
type ErrRoomKeysVersion struct {
|
||||
MatrixError
|
||||
CurrentVersion string `json:"current_version"`
|
||||
}
|
||||
|
||||
// WrongBackupVersionError is an error returned by `PUT /room_keys/keys`
|
||||
func WrongBackupVersionError(currentVersion string) *ErrRoomKeysVersion {
|
||||
return &ErrRoomKeysVersion{
|
||||
MatrixError: MatrixError{
|
||||
ErrCode: "M_WRONG_ROOM_KEYS_VERSION",
|
||||
Err: "Wrong backup version.",
|
||||
},
|
||||
CurrentVersion: currentVersion,
|
||||
}
|
||||
}
|
||||
|
||||
type IncompatibleRoomVersionError struct {
|
||||
RoomVersion string `json:"room_version"`
|
||||
Error string `json:"error"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue