Skip to content

Commit

Permalink
Pass backup version in from PerSessionKEyBackupDownloader too
Browse files Browse the repository at this point in the history
missed this one.
  • Loading branch information
richvdh committed May 24, 2024
1 parent a85c597 commit 7afa451
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/rust-crypto/PerSessionKeyBackupDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ class KeyDownloadRateLimitError extends Error {
/** Details of a megolm session whose key we are trying to fetch. */
type SessionInfo = { roomId: string; megolmSessionId: string };

/** Holds the current backup decryptor and version that should be used. */
/** Holds the current backup decryptor and version that should be used.
*
* This is intended to be used as an immutable object (a new instance should be created if the configuration changes),
* and some of the logic relies on that, so the properties are marked as `readonly`.
*/
type Configuration = {
backupVersion: string;
decryptor: BackupDecryptor;
readonly backupVersion: string;
readonly decryptor: BackupDecryptor;
};

/**
Expand Down Expand Up @@ -392,7 +396,7 @@ export class PerSessionKeyBackupDownloader {
for (const k of keys) {
k.room_id = sessionInfo.roomId;
}
await this.backupManager.importBackedUpRoomKeys(keys);
await this.backupManager.importBackedUpRoomKeys(keys, configuration.backupVersion);
}

/**
Expand Down

0 comments on commit 7afa451

Please sign in to comment.