Add new sync screen for showing recovery code#7966
Open
Conversation
This was referenced Mar 13, 2026
Member
Author
This was referenced Mar 13, 2026
This was referenced Mar 14, 2026
b0005f4 to
53d8abb
Compare
5f402ce to
fcb4307
Compare
53d8abb to
b37c36f
Compare
78156d2 to
7d1de76
Compare
c706b7f to
39f9946
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/setup/RecoverDataViewModel.kt
Show resolved
Hide resolved
fcb4307 to
bc12065
Compare
39f9946 to
41a2e18
Compare
17 tasks
41a2e18 to
984c575
Compare
bc12065 to
08db62c
Compare
984c575 to
a81b128
Compare
08db62c to
eaf246f
Compare
29313e2 to
4b355b1
Compare
a81b128 to
ae61b9d
Compare
4b355b1 to
a0f9e2d
Compare
ae61b9d to
0939797
Compare
42b11dd to
be6df5e
Compare
...mpl/src/main/java/com/duckduckgo/sync/impl/autorestore/SyncAutoRestorePreferenceDataStore.kt
Outdated
Show resolved
Hide resolved
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/setup/RecoverDataViewModel.kt
Show resolved
Hide resolved
be6df5e to
59f6888
Compare
59f6888 to
91ef838
Compare
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/488551667048375/task/1213299640229975?focus=true
Description
Adds a new "Recover Your Data Easily" screen as an alternative to the existing recovery code screen during sync setup. The new screen includes a "Restore on App Reinstall" toggle that, when enabled, persists the recovery code and device ID to Block Store when the user taps Next or Back.
recoverDataEasilySetupScreen(INTERNAL — enabled for internal builds by default)syncAutoRestoreis enabled and Block Store is available on the deviceSteps to test this PR
Notes
Sync-Recovery|Sync-AutoRestoreScenario 1:
recoverDataEasilySetupScreenOFF — old screen shown, no regressionrecoverDataEasilySetupScreenFF by hardcoding it toFALSEinternalDebugScenario 2:
recoverDataEasilySetupScreenON,syncAutoRestoreOFF — new screen shown, no togglerecoverDataEasilySetupScreentoINTERNALScenario 3:
recoverDataEasilySetupScreenON,syncAutoRestoreON — toggle ON, payload saved on NextrecoverDataEasilySetupScreenandsyncAutoRestoretoINTERNALrecovery_codeanddevice_idScenario 4:
recoverDataEasilySetupScreenON,syncAutoRestoreON — toggle turned OFF, payload clearedNote
Medium Risk
Introduces a new sync setup screen and new persistence paths (DataStore + Block Store writes/clears) that affect account recovery behavior and device state. Risk is mitigated by feature-flag gating (
recoverDataEasilySetupScreen) and additional unit test coverage, but flow/regression risk remains in setup navigation and storage availability checks.Overview
Adds an alternative “Recover Your Data Easily” recovery-code step during sync setup (new
RecoverDataFragment/RecoverDataViewModel+ layout/drawables/strings), selected via a newrecoverDataEasilySetupScreenfeature toggle.Extends auto-restore support by detecting Block Store availability (
isAutoRestoreAvailable) and introducing a persisted Restore on App Reinstall user preference via a newDataStore(SyncAutoRestorePreferenceDataStore+ DI wiring). When the toggle is enabled/disabled, the flow now writes or clears the recovery payload (recovery code + device id) in persistent storage on Next/Back.Updates internal sync dev settings to refresh Block Store values on resume, add a one-tap “store current recovery code” action, and provide a shortcut to launch the new recovery screen; adds/updates unit tests around the new availability gating and setup-screen selection.
Written by Cursor Bugbot for commit 39f9946. Configure here.