fix(admin): restore frontend onboarding analytics - #2996
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 27 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)
📝 WalkthroughWalkthroughThe PR adds explicit PostHog failure handling for frontend onboarding analytics. The admin dashboard now shows a localized error alert and hides analytics content when loading fails. Query parsing and related unit tests use the updated best-effort functions. ChangesFrontend onboarding analytics
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 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.
Actionable comments posted: 2
🤖 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 `@supabase/functions/_backend/utils/frontend_onboarding_analytics.ts`:
- Around line 114-120: Replace parseDateTimeBestEffort with
parseDateTime64BestEffort at all timestamp comparison points in the frontend
onboarding analytics query, specifying millisecond precision for startDate,
followupEndDate, and cohortEndDate boundaries. Update both test cases in
tests/frontend-onboarding-analytics.unit.test.ts at lines 50-66 and 192-210 to
assert the millisecond-preserving expressions and fractional-second boundary
behavior.
In `@tests/frontend-onboarding-analytics.unit.test.ts`:
- Around line 134-146: Extend the parameterized cases in the PostHog failure
test to include configured=false with failureReason=null and connected=false
with failureReason=null, while keeping the existing failureReason cases. Ensure
these additions independently exercise the configured and connected status
predicates used by getAdminFrontendOnboardingAnalytics.
🪄 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: ebe61cda-83e4-45aa-8c90-3ddd8a7eaff5
📒 Files selected for processing (6)
messages/en.context.jsonmessages/en.jsonsrc/pages/admin/dashboard/frontend-onboarding.vuesupabase/functions/_backend/utils/frontend_onboarding_analytics.tstests/admin-frontend-onboarding-dashboard.unit.test.tstests/frontend-onboarding-analytics.unit.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|





Summary
Motivation
The production Frontend onboarding dashboard displayed 0 attempts even though PostHog contained onboarding events. The deployed query used
toInt64OrZeroandparseDateTime64BestEffort, which PostHog rejects. The PostHog read helper translated that failure into empty rows, and the dashboard rendered those rows as real zero metrics.Business impact
Admins can once again use the dashboard to measure onboarding drop-off. Future PostHog query failures will be visible instead of silently appearing as zero customer activity.
Production evidence
toIntOrZeroandparseDateTimeBestEffortTest plan
bunx vitest run tests/frontend-onboarding-analytics.unit.test.ts tests/admin-frontend-onboarding-dashboard.unit.test.ts tests/translation-queue.unit.test.tsbun test:unitbun run lintbun run lint:backendbun run typecheck:frontendbun run typecheck:backendCHOKIDAR_USEPOLLING=1 bun run buildSummary by CodeRabbit
Bug Fixes
Tests