Skip to content

Handle sync recovery basic scenario - #9356

Merged
MiSikora merged 6 commits into
developfrom
feature/mehow/simple-sync/sync-recovery
Aug 4, 2026
Merged

Handle sync recovery basic scenario#9356
MiSikora merged 6 commits into
developfrom
feature/mehow/simple-sync/sync-recovery

Conversation

@MiSikora

@MiSikora MiSikora commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1216103556496795/task/1217050743419836?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/1216103556496795/task/1216509582049467?focus=true
API Proposals URL(s) (if applicable): N/A

Description

Wires up the "Recover Synced Data" flow in the simplified Sync Settings screen, so users can restore their synced data with a recovery code, and adds a confirmation screen shown when recovery completes.

Recovery flow:

  • Tapping "Recover Synced Data" in the disabled state now requires device authentication and then opens a new screen explaining that the recovery code from the original setup is needed.
  • Tapping "Recover Synced Data" on that screen opens the code scanner in recovery mode. The "Show QR Code" button is hidden there, since showing a code cannot recover data. Manual code entry keeps working.
  • While the code is being processed, the connecting screen shows the headline "Recovering data" instead of the pairing headline.
  • After a successful recovery the acknowledgement animation now plays before the flow completes.

Cleanup:

  • Commands with no equivalent in the simplified flow (AskRemoveDevice, AskSetupSyncDeepLink, AskTurnOffSync, ShowRecoveryCode) are now explicit no-ops instead of TODO logs.
  • The unused ShowDeviceConnected command is removed from the existing Sync Settings screen.

Steps to test this PR

Note

Prepare yourself a recovery PDF before executing these tests.

Recover synced data with a recovery code

  • On a device with sync disabled, open Sync Dev Settings.
  • Tap "Launch Sync Settings V2".
  • Tap "Recover Synced Data".
  • Complete the device authentication prompt.
  • Verify the "Recover your synced data" screen opens.
  • Tap "Recover Synced Data".
  • Verify the scanner opens without a "Show QR Code" button.
  • Scan a recovery code QR code.
  • Verify the connecting screen shows the headline "Recovering data".
  • Verify the acknowledgement animation plays.
  • Verify the "Sync & Backup enabled" screen opens.
  • Tap "Done".
  • Verify the confirmation screen with a recovery code opens.

Scan a pairing code from the recovery flow

  • With sync disabled, tap "Recover Synced Data" in Sync Settings.
  • Tap "Recover Synced Data" on the recovery screen.
  • Scan the QR code shown on another device's "Sync With Another Device" screen.
  • Complete the pairing confirmation dialogs.
  • Verify the confirmation screen with a recovery code opens.

Scan a recovery code from the pairing flow

  • With sync disabled, tap "Sync With Another Device" in Sync Settings.
  • Scan a recovery code QR code.
  • Verify the confirmation screen with a recovery code opens.

UI changes

Recover Synced Data Recovering data
1 2

Note

Medium Risk
Touches account recovery and pairing completion paths across multiple activities; incorrect OriginalFlow handling could skip or wrongly show the recovery-code step after login.

Overview
Adds the Recover Synced Data path to simplified Sync Settings v2: a new intro screen, scanner behavior in recovery mode, and completion routing driven by OriginalFlow instead of pairing role/method.

Recover flow: IntroRecoverSyncData in v2 SyncActivity now opens RecoverSyncedDataActivity (after auth), which launches ReadSyncCodeContract with OriginalFlow.RECOVER_SYNCED_DATA. In recovery mode, Show QR Code is hidden on the scanner; the exchange screen headline switches to Recovering data; v2 recovery login triggers the acknowledgement animation before finishing.

Result model: SyncPairingResult.Success now carries originalFlow (SYNC_THIS_DEVICE, SYNC_WITH_ANOTHER, RECOVER_SYNCED_DATA) instead of Role and PairingMethod. That value is passed through DisplayQrCode / ExchangeSyncCode / ReadSyncCode contracts and intents so handlePairingResult can show the recovery-code screen for sync-this-device and recover flows, but not when adding another device.

Cleanup: Removes ShowDeviceConnected / legacy SETUP_COMPLETE handling from v1 SyncActivity. Several v2 commands that have no simplified UI are explicit no-ops instead of TODO logs.

Reviewed by Cursor Bugbot for commit 9b276ef. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/v2/SyncActivity.kt Outdated
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-recovery branch from 1131a63 to eeb940d Compare August 3, 2026 12:44
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-another-device-logic branch from 94137bc to 4dccacb Compare August 3, 2026 12:44
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-recovery branch from eeb940d to 94152d2 Compare August 3, 2026 13:13
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-another-device-logic branch from 4dccacb to 75ff030 Compare August 3, 2026 13:13
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-recovery branch from 94152d2 to cbe610b Compare August 3, 2026 16:30
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-another-device-logic branch from 75ff030 to 015cca9 Compare August 3, 2026 16:30
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-recovery branch from cbe610b to 40915f5 Compare August 4, 2026 07:11
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-another-device-logic branch from 015cca9 to 4344ead Compare August 4, 2026 07:11

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 40915f5. Configure here.

MiSikora commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Aug 4, 12:40 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 4, 1:11 PM UTC: The Graphite merge of this pull request was cancelled.
  • Aug 4, 1:39 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 4, 1:41 PM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 4, 1:53 PM UTC: @MiSikora merged this pull request with Graphite.

@MiSikora
MiSikora changed the base branch from feature/mehow/simple-sync/sync-another-device-logic to graphite-base/9356 August 4, 2026 13:09
@MiSikora
MiSikora changed the base branch from graphite-base/9356 to develop August 4, 2026 13:39
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/sync-recovery branch from 40915f5 to 9b276ef Compare August 4, 2026 13:40
@MiSikora
MiSikora merged commit aa99c94 into develop Aug 4, 2026
18 checks passed
@MiSikora
MiSikora deleted the feature/mehow/simple-sync/sync-recovery branch August 4, 2026 13:53
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