feat!: track analytics for OTA Snap updates#4049
Merged
Merged
Conversation
Emits `SnapController:snapUpdated` after automatic (OTA) updates of preinstalled Snaps. Adds `ota`, `client_version`, and `client_type` properties to the `Snap Updated` analytics event, and adds `clientConfig` to `SnapControllerArgs` so the controller has access to the client type and version.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4049 +/- ##
=======================================
Coverage 98.58% 98.59%
=======================================
Files 425 425
Lines 12410 12413 +3
Branches 1969 1969
=======================================
+ Hits 12235 12238 +3
Misses 175 175 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
GuillaumeRx
approved these changes
Jun 25, 2026
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.
Changes
SnapController:snapUpdatedin#handleRegistryUpdate()after each successful OTA update. As a side effect, this also fixes missing notifications toCronjobController(cronjob re-registration) andWebSocketService(connection teardown) on OTA updates.ota: booleanto theSnapControllerSnapUpdatedEventpayload to distinguish OTA updates from user-initiated ones.snapUpdatedanalytics subscriber to track theSnap Updatedevent for OTA updates (previously all preinstalled Snap updates were silently skipped).ota,client_version, andclient_typeproperties to theSnap Updatedanalytics event.clientConfig: ClientConfigtoSnapControllerArgs(same shape asSnapRegistryControllerArgs) to give the controller access to the client type and version.Breaking changes
SnapControllerconstructor now requires aclientConfigparameter.Note
Medium Risk
Breaking constructor and messenger event contract changes require host app updates; analytics and lifecycle side effects on OTA updates are new behavior for preinstalled snaps.
Overview
SnapController:snapUpdatedgains a fifth payload fieldotaso listeners can tell over-the-air registry updates apart from user-driven ones. After a successful preinstalled snap OTA in#handleRegistryUpdate, the controller now publishes that event withota: true(andpreinstalled: true), which also drives cronjob re-registration and WebSocket teardown that previously did not run on OTA.The
Snap Updatedanalytics handler no longer skips every preinstalled update: it still skips whenpreinstalled && !ota, but records OTA withota: true. All trackedSnap Updatedevents now includeota,client_version, andclient_typefrom a new required constructor argclientConfig(sameClientConfigshape as the registry controller).Breaking:
SnapControllermust be constructed withclientConfig, and any code that publishes or asserts onsnapUpdatedmust pass theotaboolean.Reviewed by Cursor Bugbot for commit 7ea3aad. Bugbot is set up for automated code reviews on this repo. Configure here.