Skip to content

[CI] (714adde) react-native/react-native-saas - #5176

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

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-714adde-react-native-react-native-saas

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: context-mill-pr
Trigger ID: 714adde
App: react-native/react-native-saas
App directory: apps/react-native/react-native-saas
Workbench branch: wizard-ci-714adde-react-native-react-native-saas
Wizard branch: main
Context Mill branch: fix/skills-project-get-token
PostHog (MCP) branch: master
Timestamp: 2026-11-16T15:34:53.382Z
Duration: 387.1s

YARA Scanner

✓ 191 tool calls scanned, 0 violations detected

No violations: ✓ 191 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown
Author

Now I have all the context needed. Let me produce the evaluation.


PR Evaluation Report

Summary

This PR integrates PostHog into a React Native SaaS management app using the posthog-react-native SDK. It adds initialization with environment-based configuration, wraps the app with PostHogProvider, implements manual screen tracking, user identification on login, reset() on logout, error tracking autocapture, and custom event captures across auth, member, project, and team sagas.

Files changed Lines added Lines removed
10 +188 -8

Confidence score: 5/5 🧙

  • Email used as distinct_id: posthog.identify(email, { email }) uses the raw email address as the distinct ID rather than a stable user ID from the auth system. If the API response includes a user ID, it should be preferred. If email is truly the only identifier, it's an acceptable fallback per PostHog docs, but it risks fragmented data if users change their email. [MEDIUM]
  • No re-identification on app relaunch: When the init() saga finds an existing token in AsyncStorage and restores the session, posthog.identify() is never called, so the restored session's events remain anonymous until the user signs in again. [MEDIUM]

File changes

Filename Score Description
src/config/posthog.js 5/5 New PostHog config module with env-based initialization, error tracking, lifecycle events, and null-safe export
src/routes.js 4/5 Wraps app with PostHogProvider, adds manual screen tracking via onStateChange. Duplicated Stack.Navigator for null case is verbose but functional
src/store/modules/auth/sagas.js 4/5 Adds identify on sign-in, capture events, reset on sign-out. Uses email as distinct_id
src/store/modules/members/sagas.js 5/5 Captures member_role_updated and member_invited events with relevant properties
src/store/modules/projects/sagas.js 5/5 Captures project_created events with source/outcome properties and logging
src/store/modules/teams/sagas.js 5/5 Captures team_created and team_selected events
src/services/posthogLogger.js 5/5 Simple null-safe logger wrapper using PostHog's logging API
.env.example 5/5 Documents required environment variables
.gitignore 5/5 Excludes .env from version control
package.json 5/5 Adds posthog-react-native and required peer dependencies

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors, all imports resolve, peer deps included
Preserves existing env vars & configs Yes Existing code paths preserved; PostHog guarded by null checks so app works without it
No syntax or type errors Yes Valid JSX and saga generator syntax throughout
Correct imports/exports Yes posthog-react-native for both PostHog and PostHogProvider; react-native-config for env vars
Minimal, focused changes Yes All changes directly support PostHog integration
Pre-existing issues None —

Issues

No issues.

Other completed criteria

  • Environment variables documented in .env.example
  • .env added to .gitignore
  • package.json properly includes SDK and peer dependencies
  • Null-safe pattern ensures app functions without PostHog configured

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native ^4.87.0 added to dependencies along with peer deps (react-native-device-info, react-native-config, etc.)
PostHog client initialized Yes new PostHog(projectToken, { host, captureAppLifecycleEvents: true, errorTracking: {...}, logs: {...} }) — correct React Native pattern
capture() Yes Multiple meaningful capture calls across auth, member, project, and team sagas
identify() No posthog.identify(email, { email }) uses raw email as distinct_id; not called on session restore
Error tracking Yes errorTracking.autocapture configured with uncaughtExceptions: true and unhandledRejections: true
Reverse proxy N/A Mobile SDK — reverse proxy is not applicable

Issues

  • Email as distinct_id: posthog.identify(email, { email }) uses the user's email directly as the distinct ID. The PostHog docs recommend using a stable ID from your auth system (e.g., a database user ID). If response.data from the login API contains a user ID, that should be used instead. Email is an acceptable fallback only when no other stable identifier exists, but it risks data fragmentation if users change their email. [MEDIUM]
  • Missing identify on session restore: The init() saga restores a session from AsyncStorage when a token exists, but never calls posthog.identify(). Events captured during a restored session remain anonymous until the next explicit sign-in. Add an identify call in the init() saga when a valid session is detected. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via react-native-config
  • Host correctly configured from environment variable
  • PostHogProvider wraps the app with the initialized client
  • posthog.reset() correctly called on sign-out
  • Screen views manually tracked via posthog.screen() in onStateChange — autocapture screens disabled to avoid duplicates
  • captureAppLifecycleEvents: true enables app open/background events
  • Null-safe guards on all PostHog calls ensure the app works without configuration

PostHog insights and events ✅

Filename PostHog events Description
src/routes.js screen() Manual screen view tracking on navigation state changes with previous_screen property
src/store/modules/auth/sagas.js user_signed_in, user_signed_out Tracks sign-in with authentication_method (demo/password), sign-out triggers reset
src/store/modules/members/sagas.js member_role_updated, member_invited Tracks member management with role_count and source properties
src/store/modules/projects/sagas.js project_created Tracks project creation with source and outcome properties
src/store/modules/teams/sagas.js team_created, team_selected Tracks team creation and selection
src/config/posthog.js captureException (autocapture) Error tracking configured for uncaught exceptions and unhandled rejections

Issues

No issues.

Other completed criteria

  • Events represent real user actions in a SaaS management app (sign in → select team → create project → invite member)
  • Events enable product insights: sign-in funnel, feature adoption (projects, teams, members), error rates
  • Events include enriched contextual properties (authentication_method, source, role_count, previous_screen)
  • No PII in capture() properties — email only appears in identify() person properties where it belongs
  • Event names follow consistent snake_case convention and are descriptive of the action

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