Skip to content

[CI] (cc5471b) react-native/expo-react-native-hacker-news - #4785

Closed
wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-cc5471b-react-native-expo-react-native-hacker-news
Closed

wizard-ci-bot[bot] wants to merge 3 commits into
mainfrom
wizard-ci-cc5471b-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: scheduled
Trigger ID: cc5471b
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-cc5471b-react-native-expo-react-native-hacker-news
Wizard branch: main
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-10-28T16:54:55.497Z
Duration: 351.0s

YARA Scanner

✓ 186 tool calls scanned, 0 violations detected

No violations: ✓ 186 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app. It adds the posthog-react-native SDK, initializes it with environment-based configuration, wraps the app in PostHogProvider, adds meaningful capture events throughout the UI, configures error tracking with autocapture, and adds structured logging via a posthog-logs utility.

Files changed Lines added Lines removed
12 +171 -36

Confidence score: 5/5 🧙

  • No identify() call anywhere: The integration has no user identification. Even though this HN reader may not have auth, the integration should at minimum stub out where identify would go or note that the app is anonymous-only. [CRITICAL]
  • Web target not initialized: The app configures iOS, Android, and web platforms (app.json web config, "web" script in package.json). posthog-react-native does not work on web — it needs posthog-js with a separate setup in index.html or a web-specific provider. Web users will silently capture nothing. [CRITICAL]
  • posthog?.logger API unverified: The posthog-logs.ts utility calls posthog?.logger.info() and posthog?.logger.error(). The documented React Native SDK API uses captureLog(), not a .logger property. This may be a hallucinated API that silently does nothing at runtime. [MEDIUM]

File changes

Filename Score Description
lib/posthog.ts 4/5 Core PostHog initialization with env vars, error tracking, app lifecycle events, and dev-mode warnings
lib/posthog-logs.ts 2/5 Logging utility wrapping posthog?.logger — API may not exist on React Native SDK
app/_layout.tsx 4/5 PostHogProvider wrapping Stack navigator for screen tracking
app/[itemId].tsx 5/5 Well-placed capture calls with source properties on user interactions
components/posts/Post.tsx 5/5 Entry point tracking on story navigation with good property enrichment
components/posts/Posts.tsx 4/5 Structured logging for data fetching with timing metrics
components/Select.tsx 5/5 Feed type selection tracking
components/comments/comment.tsx 5/5 Profile and reply navigation tracking
app.config.js 5/5 Expo config properly exposing env vars via extra
.env.example 5/5 Documents required PostHog env vars
.gitignore 5/5 Correctly excludes .env
package.json 5/5 SDK dependency added correctly

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors; SDK and imports are valid
Preserves existing env vars & configs Yes Existing app.json preserved; app.config.js extends it
No syntax or type errors Yes TypeScript types are correct for PostHog React Native
Correct imports/exports Yes posthog-react-native imports are correct (PostHog, PostHogProvider)
Minimal, focused changes Yes All changes directly serve the PostHog integration
Pre-existing issues None —

Issues

  • No issues found.

Other completed criteria

  • Environment variables documented in .env.example
  • .gitignore updated to exclude .env
  • Build configuration valid — app.config.js correctly merges with app.json
  • Dev-mode console errors warn when env vars are missing

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native@^4.84.3 added to dependencies
PostHog client initialized Yes new PostHog(token, { host, captureAppLifecycleEvents, errorTracking, logs }) with PostHogProvider wrapping navigator
capture() Yes 8+ meaningful capture calls across components
identify() No No identify call anywhere in the integration
Error tracking Yes errorTracking: { autocapture: { uncaughtExceptions: true, unhandledRejections: true } } configured
Reverse proxy N/A Mobile/React Native app — reverse proxy not applicable

Issues

  • Missing identify() implementation: No posthog.identify() call exists anywhere in the codebase. While this Hacker News reader appears to lack user authentication, the integration should either implement identify for any auth flows that exist or document this as an anonymous-only app. Without identify, all events are tied to anonymous device IDs with no way to link cross-device usage. [CRITICAL]
  • Web target not initialized: app.json configures a web platform and package.json has a "web" script. posthog-react-native does not function in web environments — it requires posthog-js instead. Running the app on web will silently produce zero PostHog events. Either add posthog-js initialization for web, or explicitly remove/document the web platform gap. [CRITICAL]
  • Unverified .logger API: posthog-logs.ts calls posthog?.logger.info() and posthog?.logger.error(). The documented PostHog SDK API is captureLog(), not .logger.info(). If this property doesn't exist on the React Native SDK, the optional chaining will silently swallow the call and no logs will ever be sent. [MEDIUM]

Other completed criteria

  • API key loaded from EXPO_PUBLIC_POSTHOG_KEY environment variable (not hardcoded)
  • Host loaded from EXPO_PUBLIC_POSTHOG_HOST environment variable
  • Screen views handled via PostHogProvider wrapping the Stack navigator
  • captureAppLifecycleEvents: true captures app open/background/foreground events
  • Graceful degradation: posthog is undefined when env vars missing, app still renders

PostHog insights and events ✅

Filename PostHog events Description
app/[itemId].tsx profile_opened, story_link_opened, parent_thread_opened Tracks user profile navigation, external link opens, and thread navigation from story details
components/posts/Post.tsx story_details_opened, story_link_opened Tracks story navigation with entry_point (story_title vs comments_button) and external link opens with source
components/posts/Posts.tsx Structured logs: story feed loaded, story feed load failed, story page loaded, story page load failed Operational logging with timing, story counts, and pagination context
components/Select.tsx story_feed_selected Tracks feed type changes (top/new/best) with story_type property
components/comments/comment.tsx profile_opened, story_details_opened Tracks profile navigation from comments and reply thread navigation
lib/posthog.ts captureException (autocapture) Uncaught exceptions and unhandled rejections captured automatically

Issues

  • No issues with event quality.

Other completed criteria

  • Events represent real user actions (navigating stories, opening links, changing feeds)
  • Events enable product insights: can build content engagement funnels (feed → story → link/comments), track feature usage by feed type
  • Events enriched with contextual properties (source, entry_point, story_type, duration_ms)
  • No PII in event properties — only structural metadata
  • Consistent snake_case naming convention across all events

Reviewed by wizard workbench PR evaluator

@wizard-ci-bot wizard-ci-bot Bot added the CI/CD label Oct 28, 2026
@wizard-ci-bot wizard-ci-bot Bot closed this Oct 28, 2026
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