Skip to content

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

Open
task4233 wants to merge 1 commit into
android:mainfrom
task4233:handle-e2ee-unavailable
Open

task4233 wants to merge 1 commit into
android:mainfrom
task4233:handle-e2ee-unavailable

Conversation

@task4233

Copy link
Copy Markdown

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.

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.

1 participant