Skip to content

fix: Retry restore key creation without cloud backup when E2EE is unavailable - #224

Merged
cy245 merged 1 commit into
android:mainfrom
task4233:handle-e2ee-unavailable
Oct 9, 2026
Merged

cy245 merged 1 commit into
android:mainfrom
task4233:handle-e2ee-unavailable

Conversation

@task4233

Copy link
Copy Markdown
Contributor

WHY

createRestoreKey() swallows E2eeUnavailableException in a generic catch (e: Exception), so on a device that doesn't meet the end-to-end encryption requirements no restore key is created and the failure is silent. The implementation guide asks for the opposite:

To ensure that Restore Credentials are created in all cases, you must handle the E2eeUnavailableException explicitly by calling createCredential with isCloudBackupEnabled set to true. If E2eeUnavailableException is thrown, catch and call createCredential again with isCloudBackupEnabled set to false.

WHAT

This PR adds that retry. isCloudBackupEnabled is a constructor argument of CreateRestoreCredentialRequest rather than a field of requestJson, so the second attempt builds a new request with it set to false; the first attempt keeps the default of true.

@cy245
cy245 merged commit 807e7c2 into android:main Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants