You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support scanning URL-based sync setup codes (#5957)
Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1209921186465304?focus=true
### Description
#5944 allows the barcodes to be rendered as URL-based; this PR is the other side of the coin in adding support for scanning URL-based sync setup barcodes.
#### A note on feature flagging
For feature flagging around URL-based barcodes, I’ve separated out the ability to render them vs the ability to scan them. I think this will help the logistics around rolling it out, but sense-check that for me.
| Feature flag | Description | Default state |
|--------|--------|--------|
|`syncSetupBarcodeIsUrlBased` | Whether to render URL-based or plain barcodes | Off by default |
| `canScanUrlBasedSyncSetupBarcodes` | Whether we can scan URL-based codes | On by default (it’s a kill-switch |
### Steps to test this PR
You’ll need two devices, at least one of them being a real device so you can scan the barcode using its camera.
#### Scanning a `connect` code
- [x] Log out of sync on both devices
- [x] Choose `Sync with another device` on both
- [x] Scan the barcode **using the system camera** first, to verify you are dealing with a URL-based barcode
- [x] Scan the barcode from inside sync settings; verify sync sets up correctly
#### Scanning an `exchange` code
- [x] Log out of sync on a physical device; stay logged in on the other
- [x] Choose `Sync with another device` on both
- [x] Using physical device, scan the barcode **using the system camera** first, to verify you are dealing with a URL-based barcode
- [x] Using physical device, scan the barcode from inside sync settings; verify sync sets up correctly
#### Scanning a plaintext `recovery` code
- [x] Log out of sync on a physical device; stay logged in on the other
- [x] On the logged-in device, disable `exchangeKeysToSyncWithAnotherDevice`
- [x] Choose `Sync with another device` on both devices
- [x] Using physical device, scan the barcode **using the system camera** first, and verify you are **not** dealing with a URL-based barcode; this should be just the b64-encoded recovery code (recovery codes aren’t allowed in URLs, so disabling `exchangeKeysToSyncWithAnotherDevice` means URL-based codes won’t show either)
- [x] Using physical device, scan the barcode from inside sync settings; verify sync sets up correctly
#### Scanning a URL-based `recovery` code
This isn’t acceptable so we won’t generate URLs containing recovery codes, but let’s test what happens if one is scanned. [Barcode for testing what happens if you scan a recovery code inside a URL](https://app.asana.com/1/137249556945/task/1210110837732281?focus=true)
- [x] Log out of sync on a physical device (don’t need the other device for this test)
- [x] Choose `Sync with another device` on the physical device
- [x] Using physical device, scan the barcode linked above from inside sync settings; verify sync is **not** set up and you see an error message. In the logs, you’ll see `Recovery code found inside a URL which is not acceptable`
0 commit comments