Skip to content

Detect scanned QR sync codes - #9333

Merged
MiSikora merged 4 commits into
developfrom
feature/mehow/simple-sync/detect-scanned-code
Aug 4, 2026
Merged

Detect scanned QR sync codes#9333
MiSikora merged 4 commits into
developfrom
feature/mehow/simple-sync/detect-scanned-code

Conversation

@MiSikora

@MiSikora MiSikora commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

Description

Detects and handles QR codes scanned with the camera on the "Scan QR" tab of the simplified Sync With Another Device screen, and adds basic validation of scanned and pasted codes.

  • Scanning a sync code starts the sync process with the scanned URL. For now this opens the placeholder Sync With Another Device screen, which displays the URL.
  • Scanned codes are debounced for 5 seconds. The camera decodes continuously and emits the same code for every frame it stays in view, so without the debounce a valid code would restart the sync flow.
  • Scanning a blank code shows a "Sorry, the scanned code is invalid." snackbar instead of starting the sync process. Blank scans are debounced the same way as valid ones.
  • Pasting a blank code with the "Paste Sync Code" button on the "Enter Code" tab shows a "Sorry, the pasted code is invalid." snackbar instead of starting the sync process.

Steps to test this PR

Scan a valid sync code

  • Open Sync Dev Settings.
  • Tap "Launch Sync Settings V2".
  • Tap "Sync With Another Device".
  • Complete the device authentication prompt.
  • Tap "I’m Ready to Scan" on the "Scan QR" tab.
  • Grant the camera permission when prompted.
  • Point the camera at a sync QR code from another device.
  • Verify the placeholder Sync With Another Device screen opens and displays the scanned sync URL.

Scan an invalid code

  • On the "Scan QR" tab, point the camera at a QR code that contains only blank text (for example one generated from a single space).
  • Verify a "Sorry, the scanned code is invalid." snackbar is shown.
  • Verify the sync process does not start.

Paste an invalid code

  • Copy blank text (for example a single space) to the clipboard.
  • Open the "Enter Code" tab.
  • Tap "Paste Sync Code".
  • Verify a "Sorry, the pasted code is invalid." snackbar is shown.

UI changes

N/A


Note

Medium Risk
Changes sync pairing entry points (camera scan and paste) in v2 UI; incorrect handling could start sync with bad data or spam launches, though scope is limited to the read-sync-code screen.

Overview
Wires the Scan QR camera tab so decoded barcodes flow through ReadSyncCodeViewModel and launch the existing ExchangeSyncCode flow with the scanned text. Decoding runs while the fragment is resumed (with optional QR-only decoding when restrictScannedBarcodesToQrTypes is enabled) and stops when the lifecycle pauses.

Paste validation is tightened: blank clipboard content shows a snackbar via a new ShowMessage command instead of starting sync. The activity handles that command with a Snackbar.

Adds user-facing strings for invalid scanned/pasted codes (scanned invalid message is in resources; paste path uses it). ExchangeSyncCodeActivity uses the generic sync screen title. ViewModel tests cover scan, paste, and blank paste.

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

@MiSikora MiSikora mentioned this pull request Jul 29, 2026
9 tasks
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch from 9170a30 to faaaf23 Compare July 29, 2026 12:20
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch 2 times, most recently from efdd0e2 to 93146eb Compare July 30, 2026 12:10
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/manual-entry-ui branch from df99fd8 to 6284013 Compare July 30, 2026 12:10
@MiSikora
MiSikora changed the base branch from feature/mehow/simple-sync/manual-entry-ui to graphite-base/9333 July 30, 2026 12:41
@MiSikora
MiSikora force-pushed the graphite-base/9333 branch from 6284013 to c14ae3d Compare July 30, 2026 12:59
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch from 05629b6 to 9b554ef Compare July 30, 2026 12:59
@graphite-app
graphite-app Bot changed the base branch from graphite-base/9333 to develop July 30, 2026 12:59
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch 2 times, most recently from 41fbdeb to 9df052d Compare July 31, 2026 04:49
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch from 9df052d to 08fc11a Compare August 3, 2026 12:44

@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 2 potential issues.

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 08fc11a. Configure here.

@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch from 463e15b to b35588b Compare August 3, 2026 16:30
@MiSikora
MiSikora force-pushed the feature/mehow/simple-sync/detect-scanned-code branch from b35588b to 5cccd63 Compare August 4, 2026 07:11

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, 12:41 PM UTC: @MiSikora merged this pull request with Graphite.

@MiSikora
MiSikora merged commit 50bcde7 into develop Aug 4, 2026
18 checks passed
@MiSikora
MiSikora deleted the feature/mehow/simple-sync/detect-scanned-code branch August 4, 2026 12:41
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