Skip to content

[CI] (0ae2102) react-router/rrv7-starter#1237

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0ae2102-react-router-rrv7-starter
Closed

[CI] (0ae2102) react-router/rrv7-starter#1237
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-0ae2102-react-router-rrv7-starter

Conversation

@wizard-ci-bot
Copy link
Copy Markdown

@wizard-ci-bot wizard-ci-bot Bot commented Apr 15, 2026

Automated wizard CI run

Source: wizard-pr
Trigger ID: 0ae2102
App: react-router/rrv7-starter
App directory: apps/react-router/rrv7-starter
Workbench branch: wizard-ci-0ae2102-react-router-rrv7-starter
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-04-15T19:33:23.466Z
Duration: 421.6s

@wizard-ci-bot
Copy link
Copy Markdown
Author

wizard-ci-bot Bot commented Apr 15, 2026

Now I have all the information I need. The .env file exists locally but is NOT committed (it's not listed in the changed files). The .env.example was NOT updated with the PostHog variables. Let me compile the full review.


PR Evaluation Report

Summary

This PR integrates PostHog into a React Router v7 framework mode (SSR) app called "CloutHub." It adds client-side initialization via entry.client.tsx with PostHogProvider, a server-side middleware using posthog-node, error tracking via captureException in the ErrorBoundary, multiple capture() calls for user actions, and PostHogCaptureOnViewed for page-level visibility tracking. No user identification (identify) or reverse proxy was implemented.

Files changed Lines added Lines removed
18 +328 -262

Confidence score: 4/5 👍

  • No identify() call anywhere — no user identification is implemented despite the app having a fake user profile and follow actions. This is a fundamental PostHog integration requirement for linking events to users. [CRITICAL]
  • No reset() on logout — since there's no auth flow this is less impactful, but the omission of identification means all events are anonymous. [MEDIUM]
  • .env.example not updated — the PostHog environment variables (VITE_PUBLIC_POSTHOG_TOKEN, VITE_PUBLIC_POSTHOG_HOST) are only in an uncommitted .env file and are not documented in .env.example. Another developer cloning the repo would not know these variables are needed. [MEDIUM]
  • No reverse proxy configured — client-side posthog-js events are sent directly to us.i.posthog.com and may be blocked by ad blockers. [MEDIUM]

File changes

Filename Score Description
app/entry.client.tsx 4/5 New file — initializes posthog-js with env vars, wraps app in PostHogProvider, adds tracing headers. Follows the official React Router v7 framework mode docs closely.
app/lib/posthog-middleware.ts 5/5 New file — server-side middleware using posthog-node with context propagation and proper shutdown. Matches docs exactly.
app/root.tsx 4/5 Registers middleware, adds ErrorBoundary exception capture. Good error tracking integration.
app/routes/buy-followers.tsx 4/5 Adds three meaningful events: page viewed, package selected, purchase completed with enriched properties.
app/routes/feed.tsx 4/5 Wraps feed in PostHogCaptureOnViewed with post_count property.
app/routes/analytics.tsx 4/5 Wraps analytics dashboard in PostHogCaptureOnViewed with purchased_followers property.
app/routes/profile.tsx 4/5 Adds follow_back_clicked event with followed_username property.
app/components/PostCard.tsx 4/5 Adds post_liked/post_unliked events with properties in event handlers (not useEffect).
package.json 5/5 Correctly adds posthog-js, @posthog/react, and posthog-node.
vite.config.ts 5/5 Properly adds posthog-js and @posthog/react to SSR noExternal for dev mode.
react-router.config.ts 5/5 Enables v8_middleware future flag required for server middleware.
posthog-setup-report.md 3/5 Setup report — not harmful, but adds an unnecessary file.
Other files 3/5 Gratuitous formatting changes (whitespace, line wrapping) in header.tsx, StatCard.tsx, home.tsx, use-hydrated.ts, localStorage.ts, fake-data.ts. Not PostHog-related.

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes All dependencies added, imports correct, config valid
Preserves existing env vars & configs Yes Existing VITE_SITE_URL preserved, configs extended not replaced
No syntax or type errors Yes All code is syntactically valid TypeScript/TSX
Correct imports/exports Yes posthog-js and @posthog/react imported correctly in client components
Minimal, focused changes No Significant formatting-only changes in 6+ files (header.tsx, StatCard.tsx, home.tsx, profile.tsx, use-hydrated.ts, localStorage.ts)
Pre-existing issues None Base app appears clean

Issues

  • Gratuitous formatting changes: Multiple files have formatting-only changes (collapsing multiline JSX to single lines, removing trailing semicolons, removing trailing newlines) that are not related to the PostHog integration. These add noise to the diff and obscure the actual changes. [LOW]
  • .env.example not updated: The .env.example file was not updated with VITE_PUBLIC_POSTHOG_TOKEN and VITE_PUBLIC_POSTHOG_HOST. The .env file with these values exists locally but is not committed. [MEDIUM]

Other completed criteria

  • App builds without errors — all dependencies are in package.json, imports resolve correctly
  • Existing app code preserved — no functionality removed or broken
  • No syntax errors introduced in any changed file
  • All import statements are correct and reference the right packages
  • Build configuration is valid — vite.config.ts and react-router.config.ts are properly structured

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js ^1.369.0, @posthog/react ^1.9.0, and posthog-node ^5.29.2 added to package.json
PostHog client initialized Yes Correctly initialized in entry.client.tsx with posthog.init(), PostHogProvider, and defaults: '2026-01-30'. Server middleware uses posthog-node with withContext().
capture() Yes Multiple meaningful capture calls: post_liked, post_unliked, follower_package_selected, fake_followers_purchased, follow_back_clicked, plus viewport-triggered events
identify() No No posthog.identify() call anywhere in the codebase. The app has a fake user profile but never associates events with a user identity.
Error tracking Yes posthog?.captureException(error) in the root ErrorBoundary
Reverse proxy No No reverse proxy configured. Events are sent directly to us.i.posthog.com.

Issues

  • Missing identify(): No posthog.identify() is called anywhere in the app. The app has a fakeUser object with username and profile data, and has follow/purchase flows — all events remain anonymous. This is explicitly called out as required in the PostHog docs: "Identifying users is required." [CRITICAL]
  • No reverse proxy: Client-side events are sent directly to us.i.posthog.com which can be blocked by ad blockers. The React Router v7 framework mode docs recommend setting up a reverse proxy. [MEDIUM]
  • No reset() call: While there's no explicit logout flow, posthog.reset() should be called if logout is ever added. [LOW]

Other completed criteria

  • API key loaded from environment variable (import.meta.env.VITE_PUBLIC_POSTHOG_TOKEN)
  • Host correctly configured (import.meta.env.VITE_PUBLIC_POSTHOG_HOSThttps://us.i.posthog.com)
  • Server-side middleware properly extracts tracing headers and uses withContext() for session correlation
  • __add_tracing_headers configured for client→server event correlation
  • SSR noExternal properly configured for dev mode
  • v8_middleware: true future flag enabled in react-router.config.ts

PostHog insights and events ⚠️

Filename PostHog events Description
app/routes/feed.tsx `` (name: feed_viewed) Viewport-triggered event when feed page is visible, includes post_count property
app/components/PostCard.tsx post_liked, post_unliked Engagement tracking with post_id and post_author properties
app/routes/buy-followers.tsx `` (name: buy_followers_page_viewed), `follower_package_selected`, `fake_followers_purchased` Full purchase funnel: page view → package selection → purchase, all with enriched properties (amount, bonus, price, total_followers)
app/routes/profile.tsx follow_back_clicked Social interaction tracking with followed_username property
app/routes/analytics.tsx `` (name: analytics_dashboard_viewed) Dashboard view tracking with purchased_followers property
app/root.tsx captureException Error boundary captures all unhandled errors/exceptions

Issues

  • No PII concerns detected: Event properties contain post IDs, package indices, prices, and usernames (which are public-facing fake usernames, not real PII). This is appropriate. [No issue]

Other completed criteria

  • Events represent real user actions — liking posts, selecting packages, purchasing followers, following users, viewing pages
  • Events enable product insights — can build a purchase conversion funnel (page_viewed → package_selected → purchased), engagement trends (liked/unliked), follow-back rates
  • Events include relevant properties — post_id, post_author, package_index, amount, bonus, total_followers, price, post_count, purchased_followers
  • No PII in event properties — only public usernames and numeric identifiers
  • Event names are descriptive and consistent — snake_case convention used throughout (post_liked, follower_package_selected, fake_followers_purchased)

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