feat(analytics): add first-install lifecycle - #531
Open
Rinat S (rsolmano) wants to merge 1 commit into
Open
Rinat S (rsolmano) wants to merge 1 commit into
Rinat S (rsolmano) wants to merge 1 commit into
Conversation
Rinat S (rsolmano)
requested review from
Olga Lavrichenko (OLavrik),
Rustam Sadykov (SBOne-Kenobi) and
danyaberezun
as code owners
September 19, 2026 10:25
Rinat S (rsolmano)
added this pull request to stack #533
September 19, 2026 12:04
Olga Lavrichenko (OLavrik)
approved these changes
Sep 21, 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.
Problem
Additional analytics remains off until an explicit saved choice, while the finalized first-run experience primes sharing on when the dialog appears and treats ordinary dismissal as acceptance. Product analytics also lacks a durable first packaged-install event for acquisition denominators.
Approach
Separate startup prompting from runtime gating without changing the existing config fields: startup remains off/off, dialog mount persists the enabled preference, and confirmation only resolves the prompt. Add a server-only atomic installation marker and emit one property-minimal basic event before the first packaged
app_started.Changes
analyticsEnabled: truewhen the first-run dialog mounts; keep the dialog open until confirmation.analyticsEnabled.app_installedonce for binary/desktop, never source/CI/test, beforeapp_started.appInstalled: truethrough an atomic same-directory replacement while preserving the stable installation ID.Screenshots
Not included — copy/control structure is unchanged; the behavioral state transition is covered by browser E2E.
Testing
e2e/analytics-consent.spec.ts+e2e/privacy.spec.ts— 16 passed.Checklist
bun run lint,bun run typecheck,bun run testbun run e2e, orbun run e2e:fullwhen touching agent behavior) — focused affected E2E passed; complete suite runs on the final combined stackSPEC.md/ top-level specs updated to reflect any boundary, contract, or behavior change