fix: Fixes an issue where importing an encrypted backup file may not successfully complete in some cases
This commit is contained in:
@@ -67,6 +67,14 @@ export class DetermineKeyToUse implements SyncUseCaseInterface<AnyKey | undefine
|
|||||||
|
|
||||||
let itemsKey: ItemsKeyInterface | RootKeyInterface | KeySystemItemsKeyInterface | undefined
|
let itemsKey: ItemsKeyInterface | RootKeyInterface | KeySystemItemsKeyInterface | undefined
|
||||||
|
|
||||||
|
itemsKey = dto.recentlyDecryptedKeys.filter(isItemsKey).find((itemsKeyPayload) => {
|
||||||
|
return dto.payload.items_key_id === itemsKeyPayload.uuid
|
||||||
|
})
|
||||||
|
|
||||||
|
if (itemsKey) {
|
||||||
|
return Result.ok(itemsKey)
|
||||||
|
}
|
||||||
|
|
||||||
if (dto.payload.items_key_id) {
|
if (dto.payload.items_key_id) {
|
||||||
itemsKey = this.encryption.itemsKeyForEncryptedPayload(dto.payload)
|
itemsKey = this.encryption.itemsKeyForEncryptedPayload(dto.payload)
|
||||||
if (itemsKey) {
|
if (itemsKey) {
|
||||||
@@ -74,10 +82,6 @@ export class DetermineKeyToUse implements SyncUseCaseInterface<AnyKey | undefine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsKey = dto.recentlyDecryptedKeys.filter(isItemsKey).find((itemsKeyPayload) => {
|
|
||||||
return Result.ok(dto.payload.items_key_id === itemsKeyPayload.uuid)
|
|
||||||
})
|
|
||||||
|
|
||||||
if (itemsKey) {
|
if (itemsKey) {
|
||||||
return Result.ok(itemsKey)
|
return Result.ok(itemsKey)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user