Handle restore on reinstall sync scenario - #9368
Conversation
e1274a5 to
3055339
Compare
bf61bfc to
f78c412
Compare
f78c412 to
e589df0
Compare
6863923 to
6867b7f
Compare
375a2b0 to
ce5842d
Compare
6867b7f to
821c26d
Compare
ce5842d to
9ba6eec
Compare
821c26d to
b177968
Compare
Merge activity
|
9ba6eec to
fe4ce10
Compare
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.
Reviewed by Cursor Bugbot for commit fe4ce10. Configure here.
| } | ||
| previousSessionReadyLauncher.launch(PreviousSessionReadyContract.Input(command.originalFlow)) | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Missing onConnectionCancelled on auth cancel for non-SYNC_THIS_DEVICE flows
Low Severity
The ShowPreviousSessionReady handler calls viewModel.onConnectionCancelled() in the previousSessionReadyLauncher dismiss callback but omits it in the onCancelled and onError authentication callbacks. For the SYNC_THIS_DEVICE flow, onSyncThisDevice() calls syncSetupWideEvent.onFlowStarted(), so a subsequent onConnectionCancelled() (which fires syncSetupWideEvent.onFlowCancelled()) is needed to properly close the wide event. When auth is cancelled or errors, only onSyncThisDeviceCanceled() is called, leaving the wide event flow open without a matching cancellation signal.
Reviewed by Cursor Bugbot for commit fe4ce10. Configure here.



Task/Issue URL: https://app.asana.com/1/137249556945/project/1216103556496795/task/1216422585541212?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
Adds the recover on reinstall step to the simplified Sync & Backup setup. When the app finds Sync & Backup recovery data preserved from a previous install, starting any sync setup from the simplified Sync Settings first offers to resume the previous session instead of starting from scratch.
syncAutoRestorefeature flag is enabled.The screen reports its outcome through the new
PreviousSessionReadyContract. A finished recovery is returned as aSyncPairingResultand handled bySyncActivitythrough the existinghandlePairingResult, so completion behaves exactly like the manual recovery flow.Steps to test this PR
Setup
Resume the previous session
Set up new sync instead
Dismiss the offer
No preserved session
UI changes
Note
Medium Risk
Touches sync setup routing and recovery-code exchange after reinstall; mistakes could block setup or mishandle preserved credentials, though flows reuse existing pairing/recovery infrastructure and add tests.
Overview
When preserved Block Store recovery data exists and auto-restore is enabled, simplified Sync Settings now shows a previous session ready screen after device auth instead of jumping straight into setup.
Resume Sync & Backup returns the stored recovery code through
PreviousSessionReadyContractandSyncActivityruns the existingExchangeSyncCoderecovery path, then the normal recovery-code completion flow. Set Up New Sync clears preserved local auto-restore data (server account unchanged) and continues the flow the user originally chose—sync this device, pair with another device, or manual recovery—via the newly implementedLaunchOriginalFlowhandling. Dismissal leaves preserved data so the offer can appear again.SyncActivityViewModelresets the “sync this device” in-progress UI if clearing preserved data fails on skip-restore. Adds screen layout, illustration, strings, and ViewModel tests for the new step.Reviewed by Cursor Bugbot for commit fe4ce10. Bugbot is set up for automated code reviews on this repo. Configure here.