Skip to content

[CI] (714adde) tanstack-router/tanstack-router-code-based-saas - #5184

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-714adde-tanstack-router-tanstack-router-code-based-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-714adde-tanstack-router-tanstack-router-code-based-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: context-mill-pr
Trigger ID: 714adde
App: tanstack-router/tanstack-router-code-based-saas
App directory: apps/tanstack-router/tanstack-router-code-based-saas
Workbench branch: wizard-ci-714adde-tanstack-router-tanstack-router-code-based-saas
Wizard branch: main
Context Mill branch: fix/skills-project-get-token
PostHog (MCP) branch: master
Timestamp: 2026-11-16T15:43:50.392Z
Duration: 348.8s

YARA Scanner

✓ 159 tool calls scanned, 0 violations detected

No violations: ✓ 159 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a TanStack Router code-based SaaS app (client-only React SPA with Vite). It adds @posthog/react, wraps the app with PostHogProvider and PostHogErrorBoundary, captures custom events for invoice CRUD and auth actions, and sets up environment variables. However, it critically omits posthog.identify() on login and posthog.reset() on logout despite the app having full authentication flows.

Files changed Lines added Lines removed
5 +84 -11

Confidence score: 5/5 🧙

  • Missing posthog.identify() on login: The app has an auth system with auth.login(username) but never calls posthog.identify() to associate the user with their events. All captured events remain anonymous, defeating the purpose of user-level analytics. [CRITICAL]
  • Missing posthog.reset() on logout: Both handleLogout functions call auth.logout() and capture user_logged_out but never call posthog?.reset(). This means the next user on the same browser inherits the previous user's identity. [CRITICAL]
  • No reverse proxy configured: Events sent directly to PostHog's API host are likely to be blocked by ad blockers, reducing data quality. [MEDIUM]

File changes

Filename Score Description
.env.example 5/5 New file with VITE_PUBLIC_POSTHOG_KEY and VITE_PUBLIC_POSTHOG_HOST placeholder vars
.gitignore 5/5 Adds .env to prevent committing secrets
package.json 5/5 Adds @posthog/react dependency
src/main.tsx 3/5 PostHog provider, error boundary, capture events — but missing identify/reset
tsconfig.json 5/5 Adds vite/client types for import.meta.env support

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Valid JSX/TSX, correct Vite env var usage with import.meta.env, proper conditional rendering
Preserves existing env vars & configs Yes Only additions to .gitignore and tsconfig.json; no existing config modified
No syntax or type errors Yes All code is syntactically valid; optional chaining used correctly on posthog?.capture()
Correct imports/exports Yes PostHogErrorBoundary, PostHogProvider, usePostHog correctly imported from @posthog/react
Minimal, focused changes Yes All changes relate to PostHog integration with no unrelated refactors
Pre-existing issues None Base app appears functional

Issues

  • No issues in app sanity.

Other completed criteria

  • Environment variables documented in .env.example
  • .env added to .gitignore to prevent secret exposure
  • Build configuration valid — vite/client types added for proper import.meta.env typing
  • Dev-only console warnings when env vars are missing

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes @posthog/react ^1.11.3 added to dependencies (includes posthog-js)
PostHog client initialized Yes PostHogProvider with apiKey, api_host, and defaults: '2026-08-30' — correct pattern for React
capture() Yes Four meaningful events: invoice_created, invoice_updated, user_logged_in, user_logged_out
identify() No App has auth with auth.login(username) but never calls posthog.identify()
Error tracking Yes PostHogErrorBoundary wraps app + capture_exceptions: true in init options
Reverse proxy No No proxy configured; events sent directly to PostHog host

Issues

  • No posthog.identify() call: The app authenticates users via auth.login(username) in LoginComponent.onSubmit, but never calls posthog?.identify(username, { ... }). This means all events — including user_logged_in, invoice_created, etc. — are attributed to anonymous IDs. The integration captures actions without being able to associate them to known users, breaking the core value of user analytics. Fix: add posthog?.identify(username) after auth.login(username). [CRITICAL]
  • No posthog.reset() on logout: Both handleLogout functions in ProfileComponent and LoginComponent capture user_logged_out and call auth.logout() but never call posthog?.reset(). Without reset, the next user on the same device is associated with the previous user's distinct ID. Fix: add posthog?.reset() after auth.logout() in both logout handlers. [CRITICAL]
  • No reverse proxy: Client-side events sent directly to posthogHost are susceptible to ad-blocker interception. Fix: configure a Vite proxy or use PostHog's managed reverse proxy. [MEDIUM]

Other completed criteria

  • API key loaded from VITE_PUBLIC_POSTHOG_KEY environment variable (not hardcoded)
  • Host correctly configured from VITE_PUBLIC_POSTHOG_HOST environment variable
  • Graceful degradation when env vars missing (renders app without PostHog wrapper)
  • defaults: '2026-08-30' configuration set correctly
  • PostHogErrorBoundary wraps entire app content
  • Debug mode enabled in development via debug: import.meta.env.DEV

PostHog insights and events ⚠️

Filename PostHog events Description
src/main.tsx invoice_created Captured on successful invoice creation with invoice_id property
src/main.tsx invoice_updated Captured on successful invoice update with invoice_id property
src/main.tsx user_logged_in Captured after auth.login() in login form submit handler
src/main.tsx user_logged_out Captured before auth.logout() in both profile and login page logout handlers
src/main.tsx captureException (via PostHogErrorBoundary) Automatic exception capture for React rendering errors

Issues

  • Events lack user association: Without identify(), all these events are attributed to anonymous distinct IDs. Even well-named events like invoice_created and user_logged_in cannot be used for per-user funnel analysis or retention charts. [CRITICAL]
  • user_logged_in has no properties: The login event captures no properties (e.g., no username or login method). While the user_logged_out event also has none, the login event would benefit from at least a login method property. [LOW]

Other completed criteria

  • Events represent real user actions (invoice CRUD, auth flows)
  • Events enable product insights (login → invoice creation funnel possible once identify is added)
  • Invoice events include invoice_id as contextual property
  • No PII in event properties (invoice IDs only)
  • Consistent snake_case naming convention across all events

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants