[CI] (6fb03e7) react-router/react-router-v7-project#1484
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
[CI] (6fb03e7) react-router/react-router-v7-project#1484wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a React Router v7 framework-mode app ("CountryExplorer"). It adds client-side initialization via
Confidence score: 5/5 🧙
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | Packages installed, SSR noExternal configured, middleware flag enabled |
| Preserves existing env vars & configs | Yes | Existing code preserved; logout handler properly wrapped |
| No syntax or type errors | Yes | All files syntactically valid |
| Correct imports/exports | Yes | All imports resolve correctly (posthog-js, @posthog/react, posthog-node) |
| Minimal, focused changes | Yes | All changes directly support PostHog integration |
| Pre-existing issues | None | — |
Issues
- Missing optional chaining in ErrorBoundary:
posthog.captureException(error)inroot.tsxshould useposthog?.captureException(error)sinceusePostHog()can return undefined if PostHog isn't initialized. [LOW]
Other completed criteria
- Environment variables documented in
.envfile withVITE_PUBLIC_POSTHOG_PROJECT_TOKENandVITE_PUBLIC_POSTHOG_HOST - Build configuration valid —
package.jsondependencies correct,vite.config.tsproperly structured - All changes relevant to PostHog integration
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js, @posthog/react, and posthog-node added to package.json |
| PostHog client initialized | Yes | posthog.init() in entry.client.tsx with PostHogProvider wrapping the app; server middleware creates per-request posthog-node client |
| capture() | Yes | 7 meaningful custom events across 5 route files |
| identify() | Yes | Called on login and signup, but with inconsistent distinct_id values |
| Error tracking | Yes | captureException() in root ErrorBoundary component |
| Reverse proxy | No | Vite dev-server proxy configured at /ingest but api_host in posthog.init() still points to us.i.posthog.com, so the proxy is never used |
Issues
- Reverse proxy not connected: The proxy routes in
vite.config.tscorrectly forward/ingest/staticand/ingest/arraytous-assets.i.posthog.comand/ingestto the PostHog host. However,posthog.init()setsapi_hosttoimport.meta.env.VITE_PUBLIC_POSTHOG_HOST(https://us.i.posthog.com) rather than'/ingest'. The SDK will send requests directly to PostHog, bypassing the proxy entirely. Fix: setapi_host: '/ingest'in the init call (at least in dev). [CRITICAL] - Inconsistent distinct_id:
login.tsxcallsposthog?.identify(username, ...)using the username string, whilesignup.tsxcallsposthog?.identify(newUser.id, ...)using the nanoid-based user ID. This means the same user gets different distinct_ids depending on their path. Login should resolve the user object and useuser.idas the distinct_id. [MEDIUM]
Other completed criteria
- API key loaded from environment variable (
VITE_PUBLIC_POSTHOG_PROJECT_TOKEN) - Host correctly configured from environment variable
- Server middleware correctly uses
withContext()for session correlation posthog.reset()called on logout__add_tracing_headersenabled for client-server correlation
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
app/routes/signup.tsx |
user_signed_up |
Captured on successful signup with username and email properties |
app/routes/login.tsx |
user_logged_in |
Captured on successful login with username property |
app/routes/profile.tsx |
user_logged_out |
Captured before reset on logout |
app/routes/countries.tsx |
country_claimed, country_liked, country_visited |
User interactions with country cards, includes country name and region |
app/routes/country.tsx |
country_viewed |
Page-view event for country detail, includes country name and region |
app/root.tsx |
captureException |
Automatic error tracking in ErrorBoundary |
Issues
- PII in capture event properties:
signup.tsxsendsemail: newUser.emailin thecapture('user_signed_up', ...)properties. Email is PII and should only appear in person properties viaidentify()(which is already done correctly one line above). Removeemailfrom the capture properties. [MEDIUM]
Other completed criteria
- Events represent real user actions (signup, login, logout, country interactions)
- Events enable product insights — can build signup funnel, engagement trends, retention analysis
- Events include enriched properties (country, region for interactions)
- Event names are descriptive and use consistent snake_case convention
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: scheduled
Trigger ID:
6fb03e7App:
react-router/react-router-v7-projectApp directory:
apps/react-router/react-router-v7-projectWorkbench branch:
wizard-ci-6fb03e7-react-router-react-router-v7-projectWizard branch:
mainContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-05-13T17:38:46.628Z
Duration: 507.8s