mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Save valid backup key before downloading keys
This commit is contained in:
parent
db84c679b4
commit
3c931d6f6d
1 changed files with 4 additions and 3 deletions
|
@ -671,7 +671,6 @@ internal class DefaultKeysBackupService @Inject constructor(
|
||||||
Timber.e("restoreKeysWithRecoveryKey: Invalid recovery key for this keys version")
|
Timber.e("restoreKeysWithRecoveryKey: Invalid recovery key for this keys version")
|
||||||
throw InvalidParameterException("Invalid recovery key")
|
throw InvalidParameterException("Invalid recovery key")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a PK decryption instance
|
// Get a PK decryption instance
|
||||||
pkDecryptionFromRecoveryKey(recoveryKey)
|
pkDecryptionFromRecoveryKey(recoveryKey)
|
||||||
}
|
}
|
||||||
|
@ -680,6 +679,10 @@ internal class DefaultKeysBackupService @Inject constructor(
|
||||||
Timber.e("restoreKeysWithRecoveryKey: Invalid recovery key. Error")
|
Timber.e("restoreKeysWithRecoveryKey: Invalid recovery key. Error")
|
||||||
throw InvalidParameterException("Invalid recovery key")
|
throw InvalidParameterException("Invalid recovery key")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save for next time and for gossiping
|
||||||
|
// Save now as it's valid, don't wait for the import as it could take long.
|
||||||
|
saveBackupRecoveryKey(recoveryKey, keysVersionResult.version)
|
||||||
|
|
||||||
stepProgressListener?.onStepProgress(StepProgressListener.Step.DownloadingKey)
|
stepProgressListener?.onStepProgress(StepProgressListener.Step.DownloadingKey)
|
||||||
|
|
||||||
|
@ -729,8 +732,6 @@ internal class DefaultKeysBackupService @Inject constructor(
|
||||||
if (backUp) {
|
if (backUp) {
|
||||||
maybeBackupKeys()
|
maybeBackupKeys()
|
||||||
}
|
}
|
||||||
// Save for next time and for gossiping
|
|
||||||
saveBackupRecoveryKey(recoveryKey, keysVersionResult.version)
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
}.foldToCallback(callback)
|
}.foldToCallback(callback)
|
||||||
|
|
Loading…
Reference in a new issue