Add SyncAutoRestore API and SyncRecovery key#7910
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1213488933349586/task/1213232213875729?focus=true
Description
Adds the
SyncAutoRestoreAPI and internal dev tooling for validating Block Store integration.What's in this PR (stacked on persistent-storage module)
SyncAutoRestoreinterface insync-apiwithcanRestore()andrestoreSyncAccount()RealSyncAutoRestoreimplementation, gated behindsyncAutoRestorefeature flag (defaults FALSE)SyncRecoveryPersistentStorageKey— the key that will store the sync recovery code in Block Store (shouldBackupToCloud = true)RealSyncAutoRestoreAPI proposal: https://app.asana.com/1/137249556945/project/1202552961248957/task/1213554376592121
Steps to test this PR
QA optional
Block Store dev tooling
internalReleaseon a device with Google Play ServicesNote
Medium Risk
Introduces a new cloud-backup persistent storage key for sync recovery data and wires it into a new auto-restore capability check; misconfiguration could impact sensitive data handling. Functional impact is limited by a default-off feature flag and restore being unimplemented.
Overview
Adds a new
SyncAutoRestoreAPI plusRealSyncAutoRestoreimplementation, gated behind a newsyncAutoRestorefeature flag (default off), wherecanRestore()checks for a stored recovery token in persistent storage andrestoreSyncAccount()is currently a stub.Introduces
SyncRecoveryPersistentStorageKey(configured withshouldBackupToCloud = true) and expands Sync Internal Settings with a Block Store section to display flag/availability/E2E support and to read/write/clear the stored value for validation. Includes unit tests coveringcanRestore()behavior under flag and storage success/failure conditions.Written by Cursor Bugbot for commit e112155. Configure here.