Show internet connection warning when uploading keys on log out. (#4027)

* Show the key upload progress when waiting to log out.

Add some basic view model tests too.

* Show a network suggestion if key upload doesn't report any progress during logout.
This commit is contained in:
Doug
2025-04-15 16:47:31 +01:00
committed by GitHub
parent 5ea95913e8
commit c5bb960234
27 changed files with 270 additions and 83 deletions
@@ -27,6 +27,14 @@ enum SecureBackupKeyBackupState {
case disabling
}
/// Represents the progress towards a complete backup before logging out.
enum SecureBackupSteadyState {
case waiting
case uploading(uploadedKeyCount: Int, totalKeyCount: Int)
case error
case done
}
enum SecureBackupControllerError: Error {
case failedEnablingBackup
case failedDisablingBackup
@@ -49,5 +57,5 @@ protocol SecureBackupControllerProtocol {
func generateRecoveryKey() async -> Result<String, SecureBackupControllerError>
func confirmRecoveryKey(_ key: String) async -> Result<Void, SecureBackupControllerError>
func waitForKeyBackupUpload() async -> Result<Void, SecureBackupControllerError>
func waitForKeyBackupUpload(uploadStateSubject: CurrentValueSubject<SecureBackupSteadyState, Never>) async -> Result<Void, SecureBackupControllerError>
}