From 752f4be90da8daf5699c0b058b216d5921f2fa13 Mon Sep 17 00:00:00 2001 From: Faye Duxovni Date: Thu, 2 Jun 2022 13:15:46 -0400 Subject: [PATCH] Don't bug the user while re-checking key backups after decryption failures --- src/client.ts | 12 ------------ src/crypto/backup.ts | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/client.ts b/src/client.ts index e0f40a8a2ba..3cd18a0f0e6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -3102,18 +3102,6 @@ export class MatrixClient extends TypedEventEmitter { - const privKey = await this.crypto.backupManager.getKey(); - return this.restoreKeyBackup( - privKey, targetRoomId, targetSessionId, backupInfo, opts, - ); - } - private async restoreKeyBackup( privKey: ArrayLike, targetRoomId: undefined, diff --git a/src/crypto/backup.ts b/src/crypto/backup.ts index 94ec3c62445..2f03865824d 100644 --- a/src/crypto/backup.ts +++ b/src/crypto/backup.ts @@ -301,7 +301,7 @@ export class BackupManager { || now - this.sessionLastCheckAttemptedTime[targetSessionId] > KEY_BACKUP_CHECK_RATE_LIMIT ) { this.sessionLastCheckAttemptedTime[targetSessionId] = now; - await this.baseApis.restoreKeyBackupWithBackupManager(targetRoomId, targetSessionId, this.backupInfo, {}); + await this.baseApis.restoreKeyBackupWithCache(targetRoomId, targetSessionId, this.backupInfo, {}); } }