From 6541aacf9877a63d37d3ffa3528998e0a27f9200 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 31 Jan 2022 16:23:48 +0100 Subject: [PATCH] don't discount already finished keys in total for previous iterations --- src/matrix/e2ee/megolm/keybackup/KeyBackup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts b/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts index c693506d..de4a978b 100644 --- a/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts +++ b/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts @@ -116,7 +116,7 @@ export class KeyBackup { const txn = await this.storage.readTxn([StoreNames.inboundGroupSessions]); setAbortable(txn); // fetch total again on each iteration as while we are flushing, sync might be adding keys - total = await txn.inboundGroupSessions.countNonBackedUpSessions(); + total = amountFinished + await txn.inboundGroupSessions.countNonBackedUpSessions(); setProgress(new Progress(total, amountFinished)); const keysNeedingBackup = (await txn.inboundGroupSessions.getFirstNonBackedUpSessions(KEYS_PER_REQUEST)) .map(entry => new StoredRoomKey(entry));