mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Update the SDK, minor version, handle API breaks (#1994)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user