Update the SDK, minor version, handle API breaks (#1994)

This commit is contained in:
Doug
2023-10-31 14:56:23 +00:00
committed by GitHub
parent b2f30974e3
commit 4af881a20f
9 changed files with 63 additions and 20 deletions
@@ -122,8 +122,23 @@ class SecureBackupController: SecureBackupControllerProtocol {
}
}
func waitForKeyBackup() async {
await encryption.waitForBackupUploadSteadyState(progressListener: nil)
func waitForKeyBackupUpload() async -> Result<Void, SecureBackupControllerError> {
do {
try await encryption.waitForBackupUploadSteadyState(progressListener: nil)
return .success(())
} catch let error as SteadyStateError {
switch error {
case .BackupDisabled:
MXLog.error("Key backup disabled, continuing logout.")
return .success(())
case .Connection, .Laged:
MXLog.error("Key backup upload failure: \(error)")
return .failure(.failedUploadingForBackup)
}
} catch {
MXLog.error("Unknown key backup upload failure")
return .failure(.failedUploadingForBackup)
}
}
}
@@ -45,6 +45,8 @@ enum SecureBackupControllerError: Error {
case failedConfirmingRecoveryKey
case failedFetchingSessionState
case failedUploadingForBackup
}
// sourcery: AutoMockable
@@ -61,7 +63,7 @@ protocol SecureBackupControllerProtocol {
func isLastSession() async -> Result<Bool, SecureBackupControllerError>
func waitForKeyBackup() async
func waitForKeyBackupUpload() async -> Result<Void, SecureBackupControllerError>
}
extension SecureBackupControllerMock {