Skip to content

[CI] (22322bc) react-native/react-native-saas - #3653

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-react-native-react-native-saas
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-react-native-react-native-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: react-native/react-native-saas
App directory: apps/react-native/react-native-saas
Workbench branch: wizard-ci-22322bc-react-native-react-native-saas
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-08-28T19:29:45.607Z
Duration: 414.2s

YARA Scanner

✓ 181 tool calls scanned, 0 violations detected

No violations: ✓ 181 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 React Native SaaS app using the posthog-react-native SDK. It adds initialization via environment variables (through react-native-config), manual screen tracking via React Navigation's onStateChange, user identification on login/logout, error tracking via PostHogErrorBoundary, and multiple meaningful event captures across auth, member, project, and team sagas.

Files changed Lines added Lines removed
10 +108 -9

Confidence score: 5/5 🧙

  • Incorrect identify() person properties wrapping: The `` key is passed inside userProperties, creating a nested property `: { email: "..." }` on the person profile instead of setting `email` directly. The correct call is `posthog?.identify(email, { email })`. [CRITICAL]
  • Email used as distinct_id: Both the demo and real login paths use the raw email address as the distinct_id. The docs explicitly recommend a stable ID from the auth system. The API response likely includes a user ID or the token could derive one. Using email causes fragmented data if the user changes their email. [MEDIUM]

File changes

Filename Score Description
src/config/posthog.js 4/5 PostHog initialization with env vars, dev-mode error for missing config, and captureAppLifecycleEvents enabled
src/routes.js 5/5 PostHogProvider, PostHogErrorBoundary, manual screen tracking with previous_screen property — well implemented
src/store/modules/auth/sagas.js 2/5 Identify uses email as distinct_id and wraps person properties incorrectly with ``; capture and reset calls are correct
src/store/modules/members/sagas.js 5/5 Captures member_role_updated and member_invited with enriched properties
src/store/modules/projects/sagas.js 5/5 Captures project_created with creation_mode
src/store/modules/teams/sagas.js 5/5 Captures team_created and team_selected with relevant properties
.env.example 5/5 Documents both required env vars
.gitignore 5/5 Excludes .env from version control
package.json 5/5 Adds posthog-react-native, react-native-config, react-native-svg
android/app/build.gradle 5/5 Applies react-native-config dotenv.gradle correctly

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors, dependencies properly declared, build.gradle correctly configured
Preserves existing env vars & configs Yes Existing navigation, Redux sagas, and app structure are preserved; PostHog wraps around existing components
No syntax or type errors Yes All JavaScript syntax is valid, optional chaining used consistently
Correct imports/exports Yes All imports from posthog-react-native and react-native-config are correct
Minimal, focused changes Yes All changes serve PostHog integration — no unrelated refactors
Pre-existing issues None No pre-existing issues identified

Other completed criteria

  • Environment variables documented in .env.example
  • .gitignore updated to exclude .env
  • react-native-config dotenv.gradle applied in correct location in build.gradle
  • react-native-svg added as peer dependency for posthog-react-native

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native: ^4.66.0 added to package.json
PostHog client initialized Yes new PostHog(projectToken, { host, captureAppLifecycleEvents: true, debug: __DEV__ }) in src/config/posthog.js with graceful fallback when env vars missing
capture() Yes 9 meaningful capture calls across auth, members, projects, and teams sagas
identify() No Uses raw email as distinct_id and incorrectly wraps properties in ``
Error tracking Yes PostHogErrorBoundary wraps the navigator inside PostHogProvider
Reverse proxy N/A React Native (mobile SDK) — reverse proxy only benefits browser-based posthog-js
Screen views Yes Manual screen tracking via NavigationContainer.onStateChange with posthog?.screen(), autocapture screens disabled to prevent duplicates
All targets initialized Yes posthog-react-native covers both iOS and Android from the JS layer; no separate native init needed

Issues

  • **Incorrect wrapping in identify**: `posthog?.identify(email, { : { email } })` creates a nested person property instead of setting email directly. The React Native SDK's identify(distinctId, userProperties) automatically handles property setting. Correct usage: posthog?.identify(email, { email }). [CRITICAL]
  • Email used as distinct_id: Both demo and real login flows pass the user's email as the distinct_id. The PostHog docs recommend using a stable ID from the auth system (e.g., database user ID). The API's response.data likely includes a user ID that should be used instead. Using email as distinct_id causes fragmented data if a user changes their email. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via react-native-config
  • Host correctly configured via environment variable
  • posthog?.reset() called on sign out
  • PostHog is conditionally rendered (graceful fallback when config is missing)
  • captureAppLifecycleEvents: true enables lifecycle tracking

PostHog insights and events ✅

Filename PostHog events Description
src/store/modules/auth/sagas.js user_signed_in, user_signed_out Tracks sign-in (with login_method: demo/password) and sign-out; calls identify and reset
src/store/modules/members/sagas.js member_role_updated, member_invited Tracks member management with update_mode, role_count, invitation_mode properties
src/store/modules/projects/sagas.js project_created Tracks project creation with creation_mode property
src/store/modules/teams/sagas.js team_created, team_selected Tracks team creation and selection with relevant properties
src/routes.js ``, captureException Manual screen tracking via posthog?.screen() with previous_screen; error boundary captures exceptions

Issues

  • No critical or medium issues with event quality.

Other completed criteria

  • Events represent real user actions in a SaaS product flow (sign in → select team → create project → invite members)
  • Events enable funnels and retention analysis
  • Events include contextual properties (login_method, creation_mode, role_count, team_id)
  • No PII in event properties — email only used in identify (the intended place)
  • Consistent snake_case naming convention

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