Skip to content

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

CDRussell
Copy link
Member

@CDRussell CDRussell commented Apr 21, 2025

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.

  • Note, this is disabled by default.
  • Note, this PR doesn’t handle scanning a URL-based barcode which will be in a higher branch on this stack.

ℹ️ Suggested logcat filter:

  • package:com.duckduckgo.mobile.android.debug message~:"code to include”

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

  • The feature is disabled by default, so just fresh install the app from this branch on both devices
  • For each of the following scenarios, make sure you can set up sync AND ensure that the “code to include” in logcat is NOT a URL:
    • Scanning barcode when both devices signed out
    • Scanning barcode when both devices signed in
    • Scanning barcode when scanning device is the only one signed out
    • Scanning barcode when scanning device is the only one signed in
    • Manually entering codes for the same scenarios…

Feature enabled

  • Enable 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.
  • Repeat the scenarios above,
    • ensuring the “code to include” is a URL when showing the barcode. URL should match the spec from the tech design.
    • ensuring when manually sharing the code it does NOT use a URL

Copy link
Member Author

CDRussell commented Apr 21, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@CDRussell CDRussell force-pushed the feature/craig/sync_barcode_url_support branch 6 times, most recently from c1e559b to b3a3796 Compare April 24, 2025 16:38
@CDRussell CDRussell force-pushed the feature/craig/sync_barcode_url_support branch 2 times, most recently from a1b61b8 to 4ff8eae Compare April 25, 2025 12:42
}

companion object {
const val URL_BASE = "https://duckduckgo.com/sync/pairing/#"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might need to change in a later PR because we’ll need to be able to access this from app module most likely. good for now though, just FYI it’ll probably change.

@CDRussell CDRussell force-pushed the feature/craig/sync_barcode_url_support branch 6 times, most recently from 1dc1ad0 to 2ada4fb Compare April 25, 2025 15:42
@CDRussell CDRussell changed the title Support URLs inside sync barcodes Support rendering URLs inside sync barcodes Apr 25, 2025
@CDRussell CDRussell force-pushed the feature/craig/sync_barcode_url_support branch 2 times, most recently from 1072477 to 444943d Compare April 25, 2025 16:18
barcodeContents?.let { code ->
clipboard.copyToClipboard(code)
barcodeContents?.let { contents ->
clipboard.copyToClipboard(contents.underlyingCode)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to make sure we use the underlying code and not the URL

@CDRussell CDRussell marked this pull request as ready for review April 25, 2025 16:23
@CDRussell CDRussell force-pushed the feature/craig/sync_barcode_url_support branch 2 times, most recently from f689aaf to 860b063 Compare April 28, 2025 12:58
@CDRussell CDRussell force-pushed the feature/craig/sync_barcode_url_support branch from 860b063 to 61a59a3 Compare April 29, 2025 09:50
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