-
Notifications
You must be signed in to change notification settings - Fork 997
Support rendering URLs inside sync barcodes #5944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c1e559b
to
b3a3796
Compare
a1b61b8
to
4ff8eae
Compare
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/qrcode/SyncBarcodeUrl.kt
Show resolved
Hide resolved
1dc1ad0
to
2ada4fb
Compare
1072477
to
444943d
Compare
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/SyncWithAnotherActivityViewModel.kt
Outdated
Show resolved
Hide resolved
860b063
to
61a59a3
Compare
61a59a3
to
61eaf09
Compare
68e00fa
to
3e35d17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I would like to discuss if possible the responsibility of SyncBarcodeDecorator, and how feasible do you see moving the logic inside SyncAccountRepository. If you are ok and prefer to do it later in the stack, I'm fine with that.
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/SyncConnectViewModel.kt
Outdated
Show resolved
Hide resolved
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/qrcode/SyncBarcodeDecorator.kt
Outdated
Show resolved
Hide resolved
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/qrcode/SyncBarcodeDecorator.kt
Outdated
Show resolved
Hide resolved
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/SyncWithAnotherActivityViewModel.kt
Outdated
Show resolved
Hide resolved
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/SyncWithAnotherActivityViewModel.kt
Outdated
Show resolved
Hide resolved
Will take a look at this and ping back with thoughts |
eb3b7ad
to
e832503
Compare
488f371
to
9d657cb
Compare
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/ui/SyncInternalSettingsViewModel.kt
Outdated
Show resolved
Hide resolved
sync/sync-impl/src/test/java/com/duckduckgo/sync/impl/ui/qrcode/SyncBarcodeUrlDecoratorTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks for the addressing the comments 👍
65d96d9
to
0b84d73
Compare
0b84d73
to
b3e468f
Compare
Merge activity
|
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`
Task/Issue URL: https://app.asana.com/1/137249556945/project/608920331025315/task/1209921184459923?focus=true
Description
Allows sync setup codes which appear in the QR barcode to be URL-based.
Steps to test this PR
Get two devices (or one device + one emulator) as you’ll need to scan barcodes.
Feature disabled, everything works as normal
Feature enabled
syncSetupBarcodeIsUrlBased
feature flag on a device. Note, we expect the URL to be in the barcode but the other device won’t be able to scan it successfully (implemented in a higher branch on this stack) so don’t worry about that part.