Skip to content

Fail KTLint - #1

Open
gaborszakacs wants to merge 2 commits into
developfrom
feature/ktlint-failure
Open

Fail KTLint#1
gaborszakacs wants to merge 2 commits into
developfrom
feature/ktlint-failure

Conversation

@gaborszakacs

Copy link
Copy Markdown

Task/Issue URL:
Tech Design URL:
CC:

Description:

Steps to test this PR:
1.
1.


Internal references:

Software Engineering Expectations
Technical Design Template

zsolt-marta-bitrise pushed a commit that referenced this pull request Jan 19, 2026
Task/Issue URL:
https://app.asana.com/1/137249556945/project/414730916066338/task/1210860582231062?focus=true

### Description

This PR fixes an issue when using the "Web Search" context menu did not
work sometimes.

### Steps to test this PR

- [x] Use a physical device
- [x] Bring the app in the foreground and kill it to make sure it runs
fresh for the web search
- [x] Open a different app, like Gmail
- [x] Long press on some text and select "Web Search"
- [x] Notice that DDG app loads the query
- [x] Switch back to Gmail without dismissing the DDG app
- [x] Long press on a different text and select "Web Search"
- [x] Verify that DDG app loads the new query correctly

Regression testing #1
- [x] Ensure DDG is default browser.
- [x] Ensure DDG is NOT running. Press the recent apps button and note
that you do NOT see DDG there.
- [x] Open an app that is known to open links in Custom Tabs. I.e Gmail.
- [x] Open a link from that app and ensure it is open in a DDG Custom
Tab.
- [x] Press the recent apps button and ensure the Custom Tab looks as
expected (the logo is Gmail's logo). No other instance of DDG is shown.

Regression testing #2
- [x] Ensure DDG is default browser.
- [x] Ensure DDG IS running. Press the recent apps button and note that
you see DDG there.
- [x] Open an app that is known to open links in Custom Tabs. I.e Gmail.
- [x] Open a link from that app (Gmail) and ensure it is open in a DDG
Custom Tab.
- [x] Press the recent apps button and ensure the Custom Tab looks as
expected (the logo is Gmail's logo). The other instance of DDG is shown.

---------

Co-authored-by: Ana Capatina <anikiki@gmail.com>
lpusok pushed a commit that referenced this pull request Aug 13, 2026
…go#8994)

Task/Issue URL: https://app.asana.com/1/137249556945/project/1203822806345703/task/1215999266926800?focus=true
Tech Design URL (if applicable): 

### Description
When deep-linking to set up sync (scanning from system camera app when we're the default browser) we jump straight into the sync set up flow. This set up flow can be either exchange v1 or exchange v2 depending on which code type is scanned. Right now, if processing v2 then the legacy v1 timeout can kick in and interrupt the pairing (if you don't accept usre confirmation within 10s)

This PR ensures the v1 timeout mechanism isn't running during a deep-linked v2 exchange.

### Steps to test this PR
> [!NOTE]
> QA optional. the following is the full test matrix to ensure it's working correctly if desired.

#### Setup
- **Emulator** = presenter (shows QR).
- **Device** = scanner. Two scan paths:
  - **in-app** (`isDeepLink=false`) — scan from inside the app.
  - **system camera → tap URL** (`isDeepLink=true`) — the deep-link path this PR targets.

#### Flag shorthand
- `U` = `canUseV2ConnectFlow`
- `S` = `canShowV2ConnectCode`

On **Emulator**, `S` decides which QR is generated (V2 vs Legacy). On **Device**, `U` decides whether V2 codes can be processed; `S` is irrelevant on the scanner side after this fix (that coupling was the bug).

#### Matrix

| # | Emulator flags | Device flags | Scan path | Expected |
|---|---|---|---|---|
| 1 | `U=on, S=on` (V2 QR) | `U=on, S=off` (default) | **deep link** | **Bug repro.** With fix: host-confirm dialog stays up, allow → success. |
| 2 | `U=on, S=on` (V2 QR) | `U=on, S=on` | deep link | Success (already worked pre-fix). |
| 3 | `U=on, S=off` (Legacy QR) | `U=on, S=off` | **deep link** | Legacy deep-link receiver path. Success via `pollForRecoveryKey`. |
| 4 | `U=off` (Legacy QR) | `U=off` | **deep link** | Pure legacy deep link. Success. |
| 5 | `U=on, S=on` (V2 QR) | `U=on, S=on` | in-app scan | V2 happy path. |
| 6 | `U=on, S=on` (V2 QR) | `U=on, S=off` | in-app scan | V2 happy path (display-off scanner combo). |
| 7 | `U=on, S=off` (Legacy QR) | `U=on, S=off` | in-app scan | Legacy happy path. |
| 8 | `U=off` (Legacy QR) | `U=off` | in-app scan | Pure legacy in-app. |

#### Negative check (optional)
Revert the `if (isDeepLink) return@launch` line, rerun scenario `#1` — dialog should show then be replaced by an error after ~10s. Re-apply the fix and rerun — should now stay up without being interrupted.

#### Logcat filter
```
message~:"Sync-setup|Sync-CodeDispatch|Sync-ExchangeV2"
```
On deep-link scenarios (`#1`–`#4`), watch for the **absence** of `Sync-setup: can timeout = true. time since start: …` lines — those indicate the legacy presenter polling loop is incorrectly running.



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Targets sync pairing flow timing and feature-flag combinations; scope is small but user-visible during device linking.
> 
> **Overview**
> Fixes a **deep-link sync pairing bug** where the legacy presenter path (QR generation plus `pollSecondDeviceExchangeAcknowledgement` with a ~10s timeout) could still run while the device was acting as the **joiner/scanner**, causing a spurious `ShowError` on top of an in-progress V2 confirmation dialog.
> 
> **`startExchangeProcess`** now **returns immediately when `isDeepLink` is true**, so neither V2 present nor legacy presenter QR/polling runs on the deep-link receive path; pairing stays on **`onDeepLinkCodeReceived` → `codeDispatcher.route()`**. The V2-present branch no longer needs a separate `!isDeepLink` guard because deep links exit earlier.
> 
> Adds tests that deep-link `viewState` never starts legacy acknowledgement polling when V2 master is on but display is off, or when V2 master is off.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1442737. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

1 participant