-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add observability around atb-related initialization timeouts #7181
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
ca1a5a7 to
6d22aaa
Compare
|
Privacy Review task: https://app.asana.com/0/69071770703008/1212197401100442 |
6d22aaa to
b601147
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.
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 |
...cs/statistics-impl/src/main/java/com/duckduckgo/app/statistics/pixels/StatisticsPixelName.kt
Show resolved
Hide resolved
statistics/statistics-impl/src/test/java/com/duckduckgo/app/statistics/AtbInitializerTest.kt
Show resolved
Hide resolved
e730276 to
b0d9ddc
Compare
statistics/statistics-impl/src/test/java/com/duckduckgo/app/statistics/AtbInitializerTest.kt
Show resolved
Hide resolved
b0d9ddc to
03fa2c1
Compare
mikescamell
left a comment
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.
Tested and works as expected. Nice work!
LGTM ![]()
statistics/statistics-impl/src/test/java/com/duckduckgo/app/statistics/AtbInitializerTest.kt
Show resolved
Hide resolved
03fa2c1 to
1990f71
Compare
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>
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>

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:
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
playDebugvariant and launch the appForce timeout in app referrer
playDebugvariant and launch appLaunchViewModel timed out waiting for referrertimeout_waiting_for_referrerForce timeout in pre-ATB-init plugin
timeout_atb_pre_initializer_pluginwith paramplugin=ReinstallAtbListenerNote
Emit pixels when app referrer wait or pre-ATB initialization plugins time out, with wiring, parameter cleaning, and tests.
timeout_waiting_for_referrerandtimeout_atb_pre_initializer_plugin(withpluginparam) inPixelDefinitions/.../app_initialization_timeout.json5.AtbInitializationPluginPixelSenderand sendATB_PRE_INITIALIZER_PLUGIN_TIMEOUTfromAtbInitializeron plugin timeout.LaunchViewModelfiresAppPixelName.TIMEOUT_WAITING_FOR_APP_REFERRERon referrer wait timeout.PixelParamRemovalInterceptorto remove ATB/app version where required, including forTIMEOUT_WAITING_FOR_APP_REFERRERandATB_PRE_INITIALIZER_PLUGIN_TIMEOUT.AtbInitializationPluginPixelSenderintoAtbInitializer; updateStubStatisticsModuleaccordingly.AtbInitializertimeout behavior and pixel emission; addLaunchViewModeltest asserting referrer-timeout pixel.Written by Cursor Bugbot for commit 1990f71. This will update automatically on new commits. Configure here.