fix(analytics): gate attribution capture on posthog config + stack-update ordering note - #4584
Conversation
…date ordering note
FIX 1: the attribution plugin (src/lib/plugins/attribution.js) captured
first-touch data unconditionally, shipping the attribution key on every
signup even when PostHog analytics is unconfigured. The plan required the
feature to be inert without a configured posthog key ("no key → no capture,
no signup payload attach"). install(app) now mirrors the sibling posthog.js
gating pattern: reads app.config.globalProperties.config?.analytics?.posthog
and no-ops unless phConfig?.key is set. Plugin unit tests extended to cover
key-present (captures), key-absent, null config, and undefined config
(does not capture).
FIX 2: added a MIGRATIONS.md entry documenting the required absorption
order for the attribution feature — downstream must absorb Node PR #4024
(signup attribution schema) before Vue PR #4572. An older Node stack's
SignupUser schema is .strict() and rejects the unknown attribution key, so
absorbing Vue first breaks every local signup with a 422 until Node lands.
Documents FIX 1's gate as the mitigating condition: with analytics
unconfigured the client never attaches attribution, so only
analytics-enabled downstreams are exposed to the ordering hazard.
Claude-Session: https://claude.ai/code/session_015AXhHayqcLntuU3AbX7No8
|
Warning Review limit reached
Next review available in: 21 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4584 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 40 40
Lines 1533 1535 +2
Branches 477 478 +1
=======================================
+ Hits 1527 1529 +2
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Post-merge audit follow-up on the signup-attribution feature (#4572).
analytics.posthog.keyis configured, mirroring the posthog plugin's own gate — the feature is fully inert (no sessionStorage write, no signup payload field) on deployments without analytics.Reviewers already passed pre-push: kimi gate OK (0 findings), full unit suite 2649 green, lint clean.
https://claude.ai/code/session_015AXhHayqcLntuU3AbX7No8