mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Alias key backup endpoints onto /unstable, fix key backup bugs (#1947)
* Default /unstable requests to stable endpoints if not overridden specifically with a custom route * Rewrite URL * Try something different * Fix routing manually * Fix selectLatestVersionSQL * Don't return 0 if no backup version exists * Log more useful error * fix up replace keys check * Don't enforce uniqueness on e2e_room_keys_versions_idx Co-authored-by: kegsay <kegan@matrix.org>
This commit is contained in:
parent
3e01a88a0c
commit
9e4618000e
8 changed files with 187 additions and 161 deletions
|
@ -479,7 +479,7 @@ func (d *Database) UpsertBackupKeys(
|
|||
err = d.keyBackups.updateBackupKey(ctx, txn, userID, version, newKey)
|
||||
changed = true
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("d.keyBackups.updateBackupKey: %w", err)
|
||||
}
|
||||
}
|
||||
// if we shouldn't replace the key we do nothing with it
|
||||
|
@ -490,7 +490,7 @@ func (d *Database) UpsertBackupKeys(
|
|||
err = d.keyBackups.insertBackupKey(ctx, txn, userID, version, newKey)
|
||||
changed = true
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("d.keyBackups.insertBackupKey: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue