fix(analytics): deduplicate plans page visit tracking - #2964
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a tracker that emits the Plans ChangesPlans visit tracking
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/settings/organization/Plans.vue`:
- Line 440: Update the watchEffect flow around plansVisitTracker.track(orgId) to
use an activation token and capture the organization ID being checked; only
track when both the token and captured ID still match the current page
activation and organization, preventing stale asynchronous runs from recording
visits after navigation or organization changes.
In `@src/services/plansVisitTracking.ts`:
- Line 1: Update the tracking import in plansVisitTracking.ts to use the
~/services/tracking alias instead of the relative ./tracking path.
In `@tests/plans-visit-tracking.unit.test.ts`:
- Around line 45-50: Replace the new-instance tracking test around
createPlansVisitTracker with a route-reset contract test: retain a tracker
instance, track org-1, call its reset() method, then verify tracking org-1 again
succeeds and sender is called twice. Update the related integration assertions
to require the Plans source to invoke tracker.reset(), rather than asserting
that plansVisitTracker.reset() is absent.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 14ab2bd7-40ed-4c11-8539-d330b9189669
📒 Files selected for processing (6)
docs/superpowers/plans/2026-08-09-fix-plans-user-visit-events.mddocs/superpowers/specs/2026-08-09-plans-user-visit-tracking-design.mdsrc/pages/settings/organization/Plans.vuesrc/pages/settings/organization/Usage.vuesrc/services/plansVisitTracking.tstests/plans-visit-tracking.unit.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
💤 Files with no reviewable changes (1)
- src/pages/settings/organization/Usage.vue
|





Summary
User visitevent while identifying Plans visits withpage: plansTest plan
bun lintbunx vitest run tests/plans-visit-tracking.unit.test.tsbun test:unitbun run typecheck:frontendNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation