Add sync with device activity starter params#8950
Open
MiSikora wants to merge 1 commit into
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/task/1215861182361180?focus=true
Tech Design URL (if applicable):
Description
Adds
SyncActivityWithAnotherDevicetype to the public API. It starts theSyncActivityand automatically launch the sync process.The implementation wraps incoming intents in a new
SyncSetupsealed type. Previously, we only had a public API to start the sync process via a URL when DuckDuckGo is used as the default browser and a QR code is scanned by, for example, an external camera app. This flow is now represented asSyncSetup.WithUrl, and the new one, which is mainly intended for in-app use, is represented asSyncSetup.WithAnotherDevice.Intent handling is now gated behind
(savedInstanceState == null). Depending on how you look at it, it's either a bug fix or a behavior change. The underlying issue is that our dialogs do not survive config changes. So if someone sees a dialog and there's a config change, they won't be prompted again. However, at the same time, if someone synced using these activity params, stayed on the screen, and there was a config change, they'll be prompted to sync again even though they already synced. You can verify, if you want, that this is the current behavior of the production app. In my opinion this is a bug, but I don't mind removing thesavedInstanceStategate if you disagree.Steps to test this PR
Note
You'll need two devices for these tests. I'll call them Device A and Device B.
Sync with URL (regression)
Sync with another device (new API)
UI changes
N/A
Note
Medium Risk
Touches sync account setup entry points and changes when deep-link / another-device auto-flow runs after rotation; incorrect gating could skip or duplicate pairing prompts.
Overview
Adds public
SyncActivityWithAnotherDeviceso other features can open Sync and immediately start the “sync with another device” path, with an optionalsourcetelemetry tag (same pattern as existing activity params).SyncActivitynow classifies launch intents via a privateSyncSetupsealed type: URL deep links map toWithUrl(existing QR/default-browser flow), the new param maps toWithAnotherDevice, andextractSource()also readssourcefrom the new param. Auto-start of these flows runs only whensavedInstanceState == null, so a configuration change no longer re-triggers setup after the user already progressed.Reviewed by Cursor Bugbot for commit 69445bc. Bugbot is set up for automated code reviews on this repo. Configure here.