Skip to content

[CI] (22322bc) tanstack-router/tanstack-router-file-based-saas - #3658

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-tanstack-router-tanstack-router-file-based-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-tanstack-router-tanstack-router-file-based-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 22322bc
App: tanstack-router/tanstack-router-file-based-saas
App directory: apps/tanstack-router/tanstack-router-file-based-saas
Workbench branch: wizard-ci-22322bc-tanstack-router-tanstack-router-file-based-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-08-28T19:37:23.956Z
Duration: 371.2s

YARA Scanner

✓ 171 tool calls scanned, 0 violations detected

No violations: ✓ 171 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Author

Now I have enough context to produce the full evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a TanStack Router file-based SaaS demo app. It adds posthog-js and @posthog/react, initializes PostHog in a dedicated posthog.ts module, wraps the root component with PostHogProvider, captures custom events for login/logout and invoice CRUD, and configures exception autocapture. The auto-generated routeTree.gen.ts was regenerated, adding significant noise to the diff.

Files changed Lines added Lines removed
8 +265 -342

Confidence score: 4/5 👍

  • Missing posthog.identify() call: The login handler captures user_logged_in but never calls posthog.identify(username) to link events to the user. This means all events remain anonymous despite the app having authentication. [CRITICAL]
  • No reverse proxy configured: No reverse proxy is set up, so client-side events may be blocked by ad blockers. [MEDIUM]
  • Unnecessary auto-generated file churn: The routeTree.gen.ts regeneration adds ~540 lines of diff noise and a structural change to login.tsx (removing .update({) that is unrelated to PostHog. [MEDIUM]

File changes

Filename Score Description
.env.example 5/5 Adds VITE_PUBLIC_POSTHOG_PROJECT_TOKEN and VITE_PUBLIC_POSTHOG_HOST environment variables
package.json 5/5 Adds posthog-js and @posthog/react dependencies
src/posthog.ts 4/5 New file initializing PostHog with env vars, error tracking config, and dev-mode debug. Uses defaults: '2026-01-30' instead of latest 2026-05-30
src/routeTree.gen.ts 2/5 Auto-generated file regenerated with reordering and formatting changes — adds significant noise unrelated to PostHog
src/routes/__root.tsx 5/5 Wraps app content with PostHogProvider, conditionally applied when PostHog is configured
src/routes/dashboard.invoices..tsx 5/5 Captures invoice_updated event with invoice_id property on successful mutation
src/routes/dashboard.invoices.index.tsx 5/5 Captures invoice_created event with invoice_id property on successful mutation
src/routes/login.tsx 3/5 Captures login/logout events and calls posthog.reset() on logout, but missing posthog.identify() on login. Also has unrelated structural change removing .update({ pattern

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Syntax is valid, dependencies are correct, PostHog init is guarded
Preserves existing env vars & configs Yes Only additions, no existing config modified
No syntax or type errors Yes All files are syntactically valid TypeScript/TSX
Correct imports/exports Yes posthog-js and @posthog/react imported correctly in client-side context
Minimal, focused changes No routeTree.gen.ts regeneration adds ~540 lines of diff noise; login.tsx has an unrelated structural refactor
Pre-existing issues None No pre-existing issues noted

Issues

  • Auto-generated file regenerated: The routeTree.gen.ts was fully regenerated, causing massive diff noise (reordering of declarations, removal of route manifest comment, reformatting). This is not harmful but clutters the PR. [MEDIUM]
  • Unrelated structural change in login.tsx: The .update({ component: LoginComponent }) pattern was merged into the createFileRoute call. While functionally equivalent, this is unrelated to PostHog. [LOW]

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid with correct dependency additions in package.json
  • PostHog initialization is guarded against missing env vars with a clear dev-mode error

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js@^1.422.5 and @posthog/react@^1.10.5 added to package.json
PostHog client initialized Yes posthog.init() called in src/posthog.ts with env vars for token and host, wrapped with PostHogProvider in root
capture() Yes 4 custom events: user_logged_in, user_logged_out, invoice_created, invoice_updated
identify() No Missing entirely — app has username-based auth but never calls posthog.identify() on login
Error tracking Yes capture_exceptions configured with capture_unhandled_errors: true and capture_unhandled_rejections: true
Reverse proxy No No reverse proxy configured — client-side events may be blocked by ad blockers

Issues

  • Missing posthog.identify() on login: The login handler calls auth.login(username) and captures user_logged_in, but never calls posthog.identify(username, { name: username }). All events remain anonymous despite the user being authenticated. This breaks the ability to associate sessions, events, and error tracking with specific users. Fix: Add posthog.identify(username) in the onSubmit handler after auth.login(username). [CRITICAL]
  • No reverse proxy: No reverse proxy or rewrites configured. For a client-side SPA, this means PostHog requests can be blocked by ad blockers, resulting in data loss. [MEDIUM]
  • Outdated defaults date: Uses defaults: '2026-01-30' instead of the latest 2026-05-30. [LOW]

Other completed criteria

  • API key loaded from VITE_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • Host loaded from VITE_PUBLIC_POSTHOG_HOST environment variable
  • PostHogProvider correctly wraps app content in __root.tsx
  • posthog.reset() correctly called on logout before auth.logout()
  • Dev-mode error thrown when env vars are missing, preventing silent failures

PostHog insights and events ✅

Filename PostHog events Description
src/posthog.ts captureException (auto) Unhandled errors and rejections automatically captured via capture_exceptions config
src/routes/login.tsx user_logged_in, user_logged_out Tracks login with authentication_method property, and logout with posthog.reset()
src/routes/dashboard.invoices..tsx invoice_updated Captures on successful invoice update mutation with invoice_id
src/routes/dashboard.invoices.index.tsx invoice_created Captures on successful invoice creation with invoice_id

Issues

  • No issues with event quality.

Other completed criteria

  • Events represent real user actions (login, logout, create invoice, update invoice)
  • Events enable product insights — can build a login → create → update funnel
  • Events include relevant properties (invoice_id, authentication_method)
  • No PII in event properties
  • Event names use consistent snake_case convention with descriptive action names

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