Use Event Horizon for application lifecycle#4943
Merged
Conversation
Collaborator
Generated by 🚫 Danger |
Collaborator
Project dependencies changeslist+ New Dependencies
com.automattic:eventhorizon:pocket-casts-068631373314a38e6adb54cd000fc1d1a74f86bdtree+\--- project :modules:features:account
+ \--- project :modules:features:search
+ \--- project :modules:services:analytics
+ \--- com.automattic:eventhorizon:pocket-casts-068631373314a38e6adb54cd000fc1d1a74f86bd
+ \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 -> 2.3.10 (*) |
Member
|
Is this the right patch file |
Contributor
Author
Whoops! Fixed. |
geekygecko
approved these changes
Feb 4, 2026
Collaborator
|
Version |
0abfa8b to
737683a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates Pocket Casts’ application lifecycle analytics to Automattic’s Event Horizon by introducing an EventSink bridge and updating lifecycle tracking to use monotonic time.
Changes:
- Added Event Horizon dependency and DI wiring (
EventSink+ singletonEventHorizon) in the analytics service. - Updated
AppLifecycleAnalyticsto emit Event Horizon lifecycle events and computetimeInAppviaTimeSource. - Added a small analytics testing module (
modules:services:analytics:testing) and moved/updated lifecycle unit tests accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Includes new :modules:services:analytics:testing module. |
| modules/services/utils/.../UtilsModule.kt | Provides TimeSource.Monotonic via Hilt for timing calculations. |
| modules/services/analytics/testing/.../TestEventSink.kt | Test-only sink capturing Event Horizon Trackable events. |
| modules/services/analytics/testing/build.gradle.kts | Declares the new testing module and its Event Horizon dependency. |
| modules/services/analytics/src/test/.../AppLifecycleAnalyticsTest.kt | New unit test validating lifecycle events via Event Horizon + TestTimeSource. |
| modules/services/analytics/.../di/AnalyticsModule.kt | Provides EventSink and a singleton EventHorizon. |
| modules/services/analytics/.../EventSink.kt | Implements the bridge from Event Horizon Trackable to existing Tracker + listeners. |
| modules/services/analytics/.../AppLifecycleAnalytics.kt | Emits Event Horizon lifecycle events and computes elapsed time using TimeSource. |
| modules/services/analytics/.../AnalyticsLoggingListener.kt | Filters out NoOpTracker entries from debug logging output. |
| modules/services/analytics/build.gradle.kts | Adds Event Horizon + the new testing module as test dependency. |
| gradle/libs.versions.toml | Adds the eventhorizon library coordinate. |
| app/src/test/.../AppLifecycleAnalyticsTest.kt | Removes old app-module lifecycle analytics unit test. |
737683a to
c6069fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Relates to PCDROID-419
Closes PCDROID-420
Testing Instructions
application_installedevent is triggered.application_closedevent is triggered.application_openedevent is triggered.curl -L https://github.com/user-attachments/files/25043607/version.patch | git applyapplication_updatedevent is triggered.Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xmlI have tested any UI changes...