Skip to content

[CI] (9f92c68) react-router/shopper - #2559

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-9f92c68-react-router-shopper
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-9f92c68-react-router-shopper

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 9f92c68
App: react-router/shopper
App directory: apps/react-router/shopper
Workbench branch: wizard-ci-9f92c68-react-router-shopper
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-08T17:19:33.708Z
Duration: 725.3s

YARA Scanner

✓ 48 tool calls scanned, 0 violations detected

No violations: ✓ 48 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR adds a client-side PostHog integration to a React Router v7 framework mode e-commerce app ("Shopper"). PostHog is initialized in entry.client.tsx with PostHogProvider, error tracking is added via the root ErrorBoundary, nine custom events cover the full shopping funnel, and a Vite dev-server reverse proxy routes /ingest traffic to PostHog.

Files changed Lines added Lines removed
9 +169 -4

Confidence score: 4/5 👍

  • No user identification: There is no posthog.identify() call anywhere in the app. Even though the checkout form collects user details (name, email, address), identify is never called, so all events remain anonymous. [CRITICAL]
  • Reverse proxy is dev-only: The Vite server.proxy configuration only applies during vite dev. In production (via react-router-serve), the /ingest path will not resolve, breaking all PostHog requests. [CRITICAL]
  • Search event fires on every keystroke: product_searched fires on every character typed in the search input, flooding PostHog with noisy events. Should be debounced or fired on submit/blur. [MEDIUM]

File changes

Filename Score Description
app/entry.client.tsx 4/5 PostHog initialization with PostHogProvider wrapping HydratedRouter. Uses __add_tracing_headers (private API) instead of documented tracing_headers.
app/root.tsx 5/5 Error boundary correctly captures exceptions via posthog?.captureException(error)
app/routes/cart.tsx 5/5 Three well-structured events: remove from cart, quantity update, checkout started
app/routes/checkout.tsx 4/5 order_placed event with good properties, but no identify() despite having user form data
app/routes/products..tsx 4/5 Product view and add-to-cart events with rich properties
app/routes/products.tsx 3/5 Add-to-cart and category filter events are good; search fires excessively on every keystroke
package.json 5/5 Correct dependencies added
posthog-setup-report.md 5/5 Comprehensive setup report with event table and next steps
vite.config.ts 3/5 Dev proxy correctly configured but won't work in production

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Valid TypeScript/JSX, correct dependencies, no syntax errors
Preserves existing env vars & configs Yes Existing app code preserved; changes are additive
No syntax or type errors Yes All files syntactically valid
Correct imports/exports Yes All imports from posthog-js and @posthog/react resolve correctly
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None Base app appears clean

Issues

  • Environment variables not documented: No .env.example file is committed with the required VITE_PUBLIC_POSTHOG_PROJECT_TOKEN and VITE_PUBLIC_POSTHOG_HOST variables. The setup report acknowledges this as a TODO but it should have been done. [MEDIUM]

Other completed criteria

  • Build configuration is valid — package.json scripts and vite.config.ts are correct
  • SSR noExternal for posthog-js and @posthog/react correctly prevents SSR bundling issues

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.398.6 and @posthog/react ^1.10.3 in dependencies
PostHog client initialized Yes posthog.init() in entry.client.tsx with PostHogProvider client={posthog} wrapping the app — matches documented React Router v7 framework mode pattern
capture() Yes Nine meaningful capture calls across four route files
identify() No No posthog.identify() call exists anywhere. The checkout page collects name, email, and address but never identifies the user.
Error tracking Yes posthog?.captureException(error) in root ErrorBoundary — correct pattern for React Router framework mode
Reverse proxy No Vite server.proxy only works during development. Production builds served by react-router-serve will not proxy /ingest, breaking all PostHog requests.

Issues

  • Missing identify(): The app has a checkout form with user name, email, and address fields but never calls posthog.identify(). All events remain anonymous, preventing user-level analytics, session replay association, and cross-session tracking. Should call identify with a user ID (or at minimum the email as distinct_id) during checkout. [CRITICAL]
  • Dev-only reverse proxy: The /ingest proxy in vite.config.ts server.proxy only works in Vite dev mode. In production, /ingest requests will 404. The app needs a production-ready reverse proxy (e.g., Vercel rewrites, Nginx config, or Cloudflare). Without it, PostHog will not receive any events in production. [CRITICAL]
  • Private API usage: __add_tracing_headers is used instead of the documented tracing_headers option. While this may work, it's a private API that could break without notice. [LOW]

Other completed criteria

  • API key loaded from environment variable VITE_PUBLIC_POSTHOG_PROJECT_TOKEN
  • Host correctly configured via /ingest proxy pointing to us.i.posthog.com with ui_host set separately
  • defaults: "2026-01-30" is set (slightly older than current 2026-05-30 but functional)

PostHog insights and events ✅

Filename PostHog events Description
app/routes/products..tsx product_viewed, product_added_to_cart Tracks product detail page views and add-to-cart actions with product properties
app/routes/products.tsx product_added_to_cart_from_list, product_searched, product_category_filtered Tracks list-level add-to-cart, search queries, and category filters
app/routes/cart.tsx product_removed_from_cart, cart_quantity_updated, checkout_started Tracks cart modifications and checkout funnel entry
app/routes/checkout.tsx order_placed Tracks completed orders with total, tax, item count, and categories
app/root.tsx captureException Captures unhandled errors via ErrorBoundary

Issues

  • Excessive search events: product_searched fires on every keystroke in the search input via the handleSearch handler. Typing "shoes" generates 5 separate events. Should be debounced (e.g., 300ms) or fired on blur/submit. [MEDIUM]

Other completed criteria

  • Events represent real user actions in an e-commerce funnel (view → add to cart → checkout → order)
  • Events enable product insights — can build a purchase funnel, track cart abandonment, analyze popular products
  • Events include contextual properties (product_id, name, category, price, quantity, cart_total, item_count)
  • No PII in event properties — names and emails from checkout form are not passed to capture
  • Event names are descriptive and consistently use snake_case

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