Skip to content

Conversation

@CDRussell
Copy link
Member

@CDRussell CDRussell commented Nov 24, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/608920331025315/task/1212017534631022?focus=true

Description

Add pixel for when timeouts happen in app initialisation paths:

  • when a pre-ATB-initialization plugin times out
  • when the app times out waiting for a referrer

Steps to test this PR

Add logcat filter: message~:message~:"Waiting for referrer|Initializing ATB|Variants update|Initialized ATB|ull referrer stri|Result determined|for referrer|posting initial|WebView passkey support|wv|timed out|AtbInitializer|Pixel interceptor: .*atb_pre_initializer_plugin_timeout|Pixel interceptor: .*timeout_atb_pre_initializer_plugin|interceptor.*timeout_waiting_for_referrer"

Happy path

  • Fresh install playDebug variant and launch the app
  • Verify you see logs for:
AtbInitializer: About to initialize ATB; running 3 pre ATB initialization plugins
AtbInitializer: Running pre-ATB init plugin [ReinstallAtbListener]
AtbInitializer: Running pre-ATB init plugin [AuraExperimentManager]
AtbInitializer: Running pre-ATB init plugin [PlayStoreAppReferrerStateListener]

Force timeout in app referrer

  • Apply patch from Patch: Referrer timeout
  • Fresh install playDebug variant and launch app
  • Verify you see logs for LaunchViewModel timed out waiting for referrer
  • Verify you see pixel in logs for timeout_waiting_for_referrer

Force timeout in pre-ATB-init plugin

  • Delete all local changes
  • Apply patch from Patch: pre-ATB init plugin timeout
  • Fresh install and launch app
  • Verify you see pixel in logs for timeout_atb_pre_initializer_plugin with param plugin=ReinstallAtbListener

Note

Emit pixels when app referrer wait or pre-ATB initialization plugins time out, with wiring, parameter cleaning, and tests.

  • Telemetry/Pixels:
    • Add timeout_waiting_for_referrer and timeout_atb_pre_initializer_plugin (with plugin param) in PixelDefinitions/.../app_initialization_timeout.json5.
    • Introduce AtbInitializationPluginPixelSender and send ATB_PRE_INITIALIZER_PLUGIN_TIMEOUT from AtbInitializer on plugin timeout.
    • LaunchViewModel fires AppPixelName.TIMEOUT_WAITING_FOR_APP_REFERRER on referrer wait timeout.
  • Interceptors:
    • Update PixelParamRemovalInterceptor to remove ATB/app version where required, including for TIMEOUT_WAITING_FOR_APP_REFERRER and ATB_PRE_INITIALIZER_PLUGIN_TIMEOUT.
  • DI:
    • Inject AtbInitializationPluginPixelSender into AtbInitializer; update StubStatisticsModule accordingly.
  • Tests:
    • Add/extend tests for AtbInitializer timeout behavior and pixel emission; add LaunchViewModel test asserting referrer-timeout pixel.

Written by Cursor Bugbot for commit 1990f71. This will update automatically on new commits. Configure here.

Copy link
Member Author

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

@CDRussell CDRussell force-pushed the feature/craig/pixel_atb_related_timeouts branch 3 times, most recently from ca1a5a7 to 6d22aaa Compare November 26, 2025 15:40
@github-actions
Copy link
Contributor

Privacy Review task: https://app.asana.com/0/69071770703008/1212197401100442

@CDRussell CDRussell force-pushed the feature/craig/pixel_atb_related_timeouts branch from 6d22aaa to b601147 Compare November 26, 2025 16:46
@CDRussell CDRussell requested a review from Copilot November 26, 2025 16:47
@CDRussell CDRussell marked this pull request as ready for review November 26, 2025 16:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds observability around ATB-related initialization timeouts by introducing two new pixels to track when initialization steps fail to complete within expected timeframes.

  • Adds pixel tracking for pre-ATB initialization plugin timeouts
  • Adds pixel tracking for app referrer data timeouts
  • Updates timeout behavior to continue initialization even when timeouts occur

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
PixelDefinitions/pixels/app_initialization_timeout.json5 Defines two new pixels for timeout tracking with appropriate parameters
statistics/statistics-impl/src/main/java/com/duckduckgo/app/statistics/pixels/StatisticsPixelName.kt Adds ATB_PRE_INITIALIZER_PLUGIN_TIMEOUT pixel name enum
statistics/statistics-impl/src/main/java/com/duckduckgo/app/statistics/pixels/AtbInitializationPluginPixelSender.kt Implements pixel sender for ATB initialization plugin timeouts with parameter removal configuration
statistics/statistics-impl/src/main/java/com/duckduckgo/app/statistics/AtbInitializer.kt Enhances logging and adds pixel firing when pre-ATB init plugins time out
statistics/statistics-impl/src/test/java/com/duckduckgo/app/statistics/AtbInitializerTest.kt Updates tests to verify timeout behavior and pixel sending
app/src/main/java/com/duckduckgo/app/pixels/AppPixelName.kt Adds TIMEOUT_WAITING_FOR_APP_REFERRER pixel name enum
app/src/main/java/com/duckduckgo/app/launch/LaunchViewModel.kt Adds pixel firing when referrer data retrieval times out
app/src/test/java/com/duckduckgo/app/launch/LaunchViewModelTest.kt Adds test coverage for referrer timeout pixel
app/src/main/java/com/duckduckgo/app/global/api/PixelParamRemovalInterceptor.kt Configures parameter removal for the referrer timeout pixel

@CDRussell CDRussell force-pushed the feature/craig/pixel_atb_related_timeouts branch 2 times, most recently from e730276 to b0d9ddc Compare November 27, 2025 10:15
@CDRussell CDRussell force-pushed the feature/craig/pixel_atb_related_timeouts branch from b0d9ddc to 03fa2c1 Compare December 2, 2025 17:10
Copy link
Contributor

@mikescamell mikescamell left a comment

Choose a reason for hiding this comment

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

Tested and works as expected. Nice work!

LGTM :shipit:

@CDRussell CDRussell force-pushed the feature/craig/pixel_atb_related_timeouts branch from 03fa2c1 to 1990f71 Compare December 2, 2025 17:21
@CDRussell CDRussell merged commit 1dfd954 into develop Dec 2, 2025
10 checks passed
@CDRussell CDRussell deleted the feature/craig/pixel_atb_related_timeouts branch December 2, 2025 17:46
joshliebe pushed a commit that referenced this pull request Dec 4, 2025
Task/Issue URL:
https://app.asana.com/1/137249556945/project/608920331025315/task/1212017534631022?focus=true

### Description
Add pixel for when timeouts happen in app initialisation paths:
- when a pre-ATB-initialization plugin times out
- when the app times out waiting for a referrer 

### Steps to test this PR

Add logcat filter: `message~:message~:"Waiting for referrer|Initializing
ATB|Variants update|Initialized ATB|ull referrer stri|Result
determined|for referrer|posting initial|WebView passkey support|wv|timed
out|AtbInitializer|Pixel interceptor:
.*atb_pre_initializer_plugin_timeout|Pixel interceptor:
.*timeout_atb_pre_initializer_plugin|interceptor.*timeout_waiting_for_referrer"`

#### Happy path
- [x] Fresh install `playDebug` variant and launch the app
- [x] Verify you see logs for:
```
AtbInitializer: About to initialize ATB; running 3 pre ATB initialization plugins
AtbInitializer: Running pre-ATB init plugin [ReinstallAtbListener]
AtbInitializer: Running pre-ATB init plugin [AuraExperimentManager]
AtbInitializer: Running pre-ATB init plugin [PlayStoreAppReferrerStateListener]
```

#### Force timeout in app referrer

- [x] Apply patch from [Patch: Referrer
timeout](https://app.asana.com/1/137249556945/task/1212197533093318?focus=true)
- [x] Fresh install `playDebug` variant and launch app
- [x] Verify you see logs for `LaunchViewModel timed out waiting for
referrer`
- [x] Verify you see pixel in logs for `timeout_waiting_for_referrer`

#### Force timeout in pre-ATB-init plugin

- [x] Delete all local changes
- [x] Apply patch from [Patch: pre-ATB init plugin
timeout](https://app.asana.com/1/137249556945/task/1212197533093320?focus=true)
- [x] Fresh install and launch app
- [x] Verify you see pixel in logs for
`timeout_atb_pre_initializer_plugin` with param
`plugin=ReinstallAtbListener`


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Emit pixels when app referrer wait or pre-ATB initialization plugins
time out, with wiring, parameter cleaning, and tests.
> 
> - **Telemetry/Pixels**:
> - Add `timeout_waiting_for_referrer` and
`timeout_atb_pre_initializer_plugin` (with `plugin` param) in
`PixelDefinitions/.../app_initialization_timeout.json5`.
> - Introduce `AtbInitializationPluginPixelSender` and send
`ATB_PRE_INITIALIZER_PLUGIN_TIMEOUT` from `AtbInitializer` on plugin
timeout.
> - `LaunchViewModel` fires
`AppPixelName.TIMEOUT_WAITING_FOR_APP_REFERRER` on referrer wait
timeout.
> - **Interceptors**:
> - Update `PixelParamRemovalInterceptor` to remove ATB/app version
where required, including for `TIMEOUT_WAITING_FOR_APP_REFERRER` and
`ATB_PRE_INITIALIZER_PLUGIN_TIMEOUT`.
> - **DI**:
> - Inject `AtbInitializationPluginPixelSender` into `AtbInitializer`;
update `StubStatisticsModule` accordingly.
> - **Tests**:
> - Add/extend tests for `AtbInitializer` timeout behavior and pixel
emission; add `LaunchViewModel` test asserting referrer-timeout pixel.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1990f71. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Craig Russell <1336281+CDRussell@users.noreply.github.com>
CDRussell added a commit that referenced this pull request Dec 10, 2025
Task/Issue URL:
https://app.asana.com/1/137249556945/project/608920331025315/task/1212317879744549?focus=true

### Description
Follow-up to #7181 to move
pixel sending logic inside `AtbInitializer` instead of having a separate
class for it.

### Steps to test this PR

Add logcat filter: `message~:"Waiting for referrer|Initializing
ATB|Variants update|Initialized ATB|ull referrer stri|Result
determined|for referrer|posting initial|WebView passkey support|wv|timed
out|AtbInitializer|Pixel interceptor:
.*atb_pre_initializer_plugin_timeout|Pixel interceptor:
.*timeout_atb_pre_initializer_plugin|interceptor.*timeout_waiting_for_referrer"`

#### Happy path
- [x] Fresh install `playDebug` variant and launch the app
- [x] Verify you see logs for:
```
AtbInitializer: About to initialize ATB; running 3 pre ATB initialization plugins
AtbInitializer: Running pre-ATB init plugin [ReinstallAtbListener]
AtbInitializer: Running pre-ATB init plugin [AuraExperimentManager]
AtbInitializer: Running pre-ATB init plugin [PlayStoreAppReferrerStateListener]
```


#### Force timeout in pre-ATB-init plugin

- [x] Apply patch from [Patch: pre-ATB init plugin
timeout](https://app.asana.com/1/137249556945/task/1212197533093320?focus=true)
- [x] Fresh install and launch app
- [x] Verify you see pixel in logs for
`timeout_atb_pre_initializer_plugin` with param
`plugin=ReinstallAtbListener`


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Moves ATB pre-initializer timeout pixel firing into `AtbInitializer`,
removes `AtbInitializationPluginPixelSender`, updates DI and tests, and
registers pixel param removal plugin with `StatisticsPixelName`.
> 
> - **Statistics**:
> - Inlines pixel firing on pre-ATB init plugin timeout inside
`AtbInitializer.onPluginTimeout`, using `Pixel.fire` and error log.
> - Removes `AtbInitializationPluginPixelSender` and its implementation.
> - Adds `AtbInitializerPluginPixelParamRemovalPlugin` in
`StatisticsPixelName` to strip ATB param for
`timeout_atb_pre_initializer_plugin`.
> - **DI**:
> - Updates constructor and providers to inject `Pixel` into
`AtbInitializer` (replacing `AtbInitializationPluginPixelSender`) in
`StubStatisticsModule.kt`.
> - **Tests**:
> - Adjusts `AtbInitializerTest` to verify `Pixel.fire` for timeout and
not-called cases; retains existing ATB initialization behavior checks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
977da29. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Craig Russell <1336281+CDRussell@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants