Make sure we display errors when we create a recovery key and it fails (#5079)

* Make sure we display errors when we create a recovery key and it fails

* Add another preview for the error state

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
Jorge Martin Espinosa 2025-07-25 13:36:43 +02:00 committed by GitHub
parent 34848aa7f9
commit afa01e926b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 86 additions and 11 deletions

View file

@ -26,7 +26,8 @@ class FakeEncryptionService(
private val pinUserIdentityResult: (UserId) -> Result<Unit> = { lambdaError() },
private val isUserVerifiedResult: (UserId) -> Result<Boolean> = { lambdaError() },
private val withdrawVerificationResult: (UserId) -> Result<Unit> = { lambdaError() },
private val getUserIdentityResult: (UserId) -> Result<IdentityState?> = { lambdaError() }
private val getUserIdentityResult: (UserId) -> Result<IdentityState?> = { lambdaError() },
private val enableRecoveryLambda: (Boolean) -> Result<Unit> = { lambdaError() },
) : EncryptionService {
private var disableRecoveryFailure: Exception? = null
override val backupStateStateFlow: MutableStateFlow<BackupState> = MutableStateFlow(BackupState.UNKNOWN)
@ -87,7 +88,7 @@ class FakeEncryptionService(
}
override suspend fun enableRecovery(waitForBackupsToUpload: Boolean): Result<Unit> = simulateLongTask {
return Result.success(Unit)
return enableRecoveryLambda(waitForBackupsToUpload)
}
fun givenWaitForBackupUploadSteadyStateFlow(flow: Flow<BackupUploadState>) {