fix(activation): land outcome tracking on main#5590
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…p from one source - export proActivationStepId from convex/schema.ts and import it in convex/payments/billing.ts instead of a hand-duplicated literal union (schema.ts and billing.ts previously listed the same 3 literals independently, with nothing to catch drift) - derive MAX_PRO_ACTIVATION_OUTCOME_REVISION and the disjoint-steps bound from proActivationStepId.members.length instead of hardcoded literals (4 and 3), which had zero headroom above the wizard's exact worst-case call count and would silently start rejecting writes if a step or a progress-call site were ever added Found in ce-code-review of #5584 (forward-ported here as #5590); both findings independently validated. Convex billing suite (149/149) and full typecheck pass unchanged.
…stitial openProActivationFlow opened the interstitial (wiring onProgress/onExit to recordProActivationOutcome) BEFORE awaiting confirmPresentationWithRetry. If a user interacted with a step in the window before that awaited call resolved and confirmPresentationWithRetry then failed (lost claim ownership, or transport errors exhausting the retry schedule), recordProActivationOutcome's own defensive presentedAt backfill had already fired -- permanently blocking a legitimate future re-claim via claimProActivationPresentation's already_presented check, even though the server never actually acknowledged this presentation. Move the confirmPresentationWithRetry await ahead of dependencies.openInterstitial(...) so the interstitial (and therefore its onProgress/onExit handlers) cannot exist until the presentation is genuinely confirmed. subscribeAuthState's reactive stale-account guard is unaffected: it still subscribes immediately after open and checks current state synchronously on subscribe. Adds a regression test (e2e/pro-activation.spec.ts) that holds confirm pending, asserts the interstitial is not mounted while it is in flight, then resolves confirm with failure and asserts no outcome write occurred. Verified red on the prior ordering (overlay count 1 while confirm was pending) and green on this fix. Found in ce-code-review of #5584 (forward-ported here as #5590; the presentedAt/claimProActivationPresentation code is unchanged by later outcomeTrackingVersion commits on this branch). Full e2e/pro-activation spec (22/22), frontend typecheck, and lint pass.
…give-up path Two test gaps flagged in ce-code-review of #5584/#5590: - tests/report-activation-lift.test.mjs: no test drove analyzeActivationLift() to the 'no-mature-outcomes' verdict -- the state the script is realistically in immediately post-launch, before any presentation has completed its observation window. Adds a case with every presentation still immature and asserts the verdict, empty engaged/presentedOnly summaries, and the formatted report message. - e2e/pro-activation.spec.ts: no test exercised persistActivationOutcomeWithRetry's retry-then-give-up path -- the existing recordOutcome mock always resolved true. Adds an outcomeAlwaysFails harness option and a test asserting exactly 3 attempts (1 initial + the 2 scheduled OUTCOME_WRITE_RETRY_DELAYS_MS retries), that it stops retrying afterward, and that the best-effort failure never blocks the flow (summary stays interactive, finish still closes the overlay). Full e2e/pro-activation spec (23/23), report-activation-lift tests (7/7), typecheck, and lint pass.
This was referenced Jul 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.
Summary
mainIntent
#5584 was merged into
codex/pro-activation-first-cycle-backfillafter #5564 had already merged intomain. Its implementation andCloses #5582reference therefore never reached the default branch.This PR applies that implementation to current
main:Non-goals remain unchanged: no live dashboard, randomized control, retroactive reconstruction, or unrelated refactor.
Closes #5582.
Validation Matrix
1734c5465fec98e30743b12840a7e6016afeb250; follow-up changes preserve that implementation and add one shared-constants fileReview Gates
Documentation
Not applicable. The on-demand script includes its usage, read-only behavior, cohort caveat, and configuration flags; no public API or user documentation contract changes.
Screenshots / UI Evidence
Not applicable. This forward-port adds persistence and an operator report without changing rendered UI.
Residual Findings
None.