Skip to content

Commit

Permalink
Fix typo in countKeysInBackup
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Nov 7, 2024
1 parent 0112d37 commit 250b7e9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rust-crypto/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ export class RustBackupManager extends TypedEventEmitter<RustBackupCryptoEvents,
*/
private keysCountInBatch(batch: RustSdkCryptoJs.KeysBackupRequest): number {
const parsedBody: KeyBackup = JSON.parse(batch.body);
return countKeystInBackup(parsedBody);
return countKeysInBackup(parsedBody);
}

/**
Expand Down Expand Up @@ -656,7 +656,7 @@ export class RustBackupManager extends TypedEventEmitter<RustBackupCryptoEvents,

const CHUNK_SIZE = 200;
// Get the total count as a first pass
const totalKeyCount = countKeystInBackup(keyBackup);
const totalKeyCount = countKeysInBackup(keyBackup);
let totalImported = 0;
let totalFailures = 0;

Expand Down Expand Up @@ -843,10 +843,9 @@ export function decryptionKeyMatchKeyBackupInfo(decryptionKey: Uint8Array, keyBa
/**
* Counts the total number of keys present in a key backup.
* @param keyBackup - The key backup to count the keys from.
*
* @returns The total number of keys in the backup.
*/
function countKeystInBackup(keyBackup: KeyBackup): number {
function countKeysInBackup(keyBackup: KeyBackup): number {
let count = 0;
for (const { sessions } of Object.values(keyBackup.rooms)) {
count += Object.keys(sessions).length;
Expand Down

0 comments on commit 250b7e9

Please sign in to comment.