Skip to content

Add simplified device backup flow#9210

Merged
MiSikora merged 2 commits into
developfrom
feature/mehow/simple-sync/backup-device
Jul 20, 2026
Merged

Add simplified device backup flow#9210
MiSikora merged 2 commits into
developfrom
feature/mehow/simple-sync/backup-device

Conversation

@MiSikora

@MiSikora MiSikora commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1216103556496795/task/1216422585541210?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/1216103556496795/task/1216509582049467?focus=true

Description

Adds the "back up this device" flow to the simplified sync UI. When a signed-out user turns on the Sync this device toggle on the new sync settings screen, they now go through a dedicated intro screen and can create a sync account to back this device up.

Added:

  • Sync This Device intro screen (SyncThisDeviceActivity) with two CTAs — "Sync With Another Device" and "Sync This Device Only".
  • Account creation ("Sync This Device Only") — creates the sync account and reports into the sync-setup wide-event funnel.
  • Toggle → flow wiring in the v2 SyncActivity via SyncThisDeviceContract (ActivityResultContract), including device authentication, device-unsupported and passcode-enrollment guards.

Not implemented here (follow-up PRs):

  • The recovery code screen is a placeholder (RecoveryCodeActivity). A successful backup routes to it, but showing/saving the recovery code (and the PDF) will come in its own PR — I'd rather isolate it.
  • The Sync With Another Device button on the intro screen isn't wired to the pairing flow yet (it currently returns to settings).

Steps to test this PR

Back up this device (simplified sync)

  • Go to the "Sync Dev Settings".
  • Tap "Launch Sync Settings V2".
  • Toggle "Sync & Backup this device".
  • Confirm the intro screen shows both CTAs.
  • Tap the X on the intro screen.
  • Confirm that it returns to settings with the toggle unchecked.
  • Toggle "Sync & Backup this device".
  • Tap "Sync This Device Only".
  • Complete device authentication.
  • Confirm the account is created (device shows as backed up / signed in).

UI changes

Intro page Syncing state
pre post

Note

Medium Risk
Creates sync accounts and runs device authentication in user-facing flows; recovery code handling is stubbed and several other v2 sync commands remain unimplemented.

Overview
Adds the simplified “back up this device” path on Sync Settings v2: turning on Sync & Backup this device runs the existing setup checks, then device auth, then a new intro screen instead of the legacy setup intro.

Sync this device intro (SyncThisDeviceActivity) offers Sync With Another Device (returns a dedicated result; pairing is not wired yet) and Sync This Device Only, which calls SyncAccountRepository.createAccount(), shows a syncing state on the CTA, and emits sync-setup wide events and signup pixels. Results flow back through SyncThisDeviceContract into v2 SyncActivity, which refreshes devices on success and opens a placeholder RecoveryCodeActivity.

Toggle UX: canceling auth, closing the intro, or dismissing passcode enrollment triggers SyncThisDeviceCanceled, which unchecks the toggle on v2 (legacy SyncActivity ignores this command). Manifest registers the new activities; copy and artwork support the intro layout.

Tests cover SyncThisDeviceViewModel account/signup/error paths and onSyncThisDeviceCanceled on the shared view model.

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

MiSikora commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread sync/sync-impl/src/main/AndroidManifest.xml
@MiSikora MiSikora mentioned this pull request Jul 17, 2026
12 tasks
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/backup-device branch from 36585da to 1e0ae38 Compare July 20, 2026 09:10

@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 1e0ae38. Configure here.


private val syncThisDeviceListener = OnCheckedChangeListener { _, isChecked ->
if (isChecked) viewModel.onSyncThisDevice(launchSource)
}

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.

Unchecking toggle won't cancel flow

Medium Severity

syncThisDeviceListener only calls onSyncThisDevice when the switch is checked. Turning the toggle off during an in-progress setup does not invoke onSyncThisDeviceCanceled or onConnectionCancelled, so auth or SyncThisDeviceActivity can still run while the UI shows sync off.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1e0ae38. Configure here.

MiSikora commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 20, 9:43 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 20, 9:44 AM UTC: @MiSikora merged this pull request with Graphite.

@MiSikora
MiSikora merged commit bde041e into develop Jul 20, 2026
20 checks passed
@MiSikora
MiSikora deleted the feature/mehow/simple-sync/backup-device branch July 20, 2026 09:44
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