Skip to content

[CI] (714adde) react-native/expo-react-native-hacker-news - #5180

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

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

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/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-714adde-react-native-expo-react-native-hacker-news
Wizard branch: main
Context Mill branch: fix/skills-project-get-token
PostHog (MCP) branch: master
Timestamp: 2026-11-16T15:37:42.604Z
Duration: 569.7s

YARA Scanner

✓ 199 tool calls scanned, 0 violations detected

No violations: ✓ 199 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. The SDK's .logger.info() API, logs config, and errorTracking config are all valid. The app targets iOS, Android, and Web. Let me produce the full review.


PR Evaluation Report

Summary

This PR integrates PostHog into an Expo React Native Hacker News reader app. It adds the posthog-react-native SDK with error tracking and logging, wraps the app in PostHogProvider, and adds meaningful custom event captures across story browsing, comment viewing, and navigation flows. Screen view tracking is explicitly disabled, which is a notable gap for a mobile app.

Files changed Lines added Lines removed
11 +188 -43

Confidence score: 5/5 🧙

  • Screen views disabled: captureScreens: false in the PostHogProvider autocapture config means zero screen view events are captured. For a multi-screen mobile app, this is essential for understanding navigation patterns and building funnels. [CRITICAL]
  • No user identification: The app has no auth system, so identify() cannot be called. This is acceptable for a read-only HN client, but limits person-level analytics. [MEDIUM]

File changes

Filename Score Description
lib/posthog.ts 4/5 PostHog initialization with env var validation, error tracking, and logging config. Well-structured with graceful null handling.
app/_layout.tsx 4/5 PostHogProvider wrapper with autocapture config, but captureScreens: false disables screen views
app.config.js 5/5 Expo config to pass env vars through extra
.env.example 5/5 Documents required env vars
package.json 5/5 Adds posthog-react-native and required peer deps
app/[itemId].tsx 5/5 Event captures on user profile, external link, and parent story navigation
app/index.tsx 5/5 Event capture on feed type selection
components/posts/Post.tsx 5/5 Event captures on story opens, discussion opens, and external links
components/comments/comment.tsx 5/5 Event captures on user profile and comment reply navigation
api/endpoints.ts 4/5 Refactored to consolidated helper + added PostHog log calls. Minor scope creep from the refactor.
.gitignore 5/5 Excludes .env file

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors, valid TypeScript, all imports resolve
Preserves existing env vars & configs Yes Existing app.json preserved, app.config.js extends it
No syntax or type errors Yes All PostHog API usage matches verified SDK types
Correct imports/exports Yes posthog-react-native and expo-constants imports are correct
Minimal, focused changes Yes All changes are PostHog-related; endpoint refactor is minor
Pre-existing issues None Base app appears clean

Issues

  • Endpoint refactoring: The api/endpoints.ts file consolidates 4 separate fetch functions into one parameterized getStories() helper. While it makes the logging addition cleaner, the refactoring itself is not strictly required for PostHog. [LOW]

Other completed criteria

  • Environment variables documented in .env.example
  • .env added to .gitignore
  • app.config.js correctly passes env vars through Expo's extra config
  • Build configuration valid — peer dependencies (expo-device, expo-file-system, expo-localization) included

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native v4.44.0 with required peer deps
PostHog client initialized Yes new PostHog(projectToken, { host, ... }) with graceful null fallback
capture() Yes 8+ meaningful capture calls across story, comment, and navigation flows
identify() N/A App is a read-only HN client with no authentication system
Error tracking Yes errorTracking: { autocapture: { uncaughtExceptions: true, unhandledRejections: true } }
Reverse proxy N/A Mobile SDK — reverse proxy only benefits browser-based posthog-js
Screen views No captureScreens: false explicitly disables screen view tracking
All targets initialized Yes posthog-react-native handles iOS, Android, and Expo Web from a single init

Issues

  • Screen views disabled: The PostHogProvider autocapture config sets captureScreens: false, which means no screen view events will be sent. For a multi-screen navigation app (home → story details → user profiles → comments), screen views are essential for understanding user navigation patterns and building screen-based funnels. Set captureScreens: true or remove the property to use the default. [CRITICAL]

Other completed criteria

  • API key loaded from environment variable via expo-constants → app.config.js → POSTHOG_PROJECT_TOKEN
  • Host correctly configured via POSTHOG_HOST env var
  • captureAppLifecycleEvents: true enabled for mobile lifecycle tracking
  • Logging configured with serviceName and serviceVersion
  • PostHog client is properly null-guarded with posthog? optional chaining throughout
  • Dev-mode warnings for missing configuration

PostHog insights and events ✅

Filename PostHog events Description
app/index.tsx story_feed_selected Tracks which feed type (top/best/ask/show) the user selects
app/[itemId].tsx user_profile_opened, external_story_opened, discussion_opened Tracks user navigation from story detail page
components/posts/Post.tsx external_story_opened, discussion_opened Tracks story list interactions — opening external links vs discussions
components/comments/comment.tsx user_profile_opened, discussion_opened Tracks comment-level interactions — viewing authors and reply threads
api/endpoints.ts Log events via posthogLog.info() Logs API requests for feed, item, and user data
lib/posthog.ts captureException (autocapture) Automatic exception and unhandled rejection tracking

Issues

  • No issues with event quality. Events are well-structured with consistent naming and meaningful properties.

Other completed criteria

  • Events represent real user actions (browsing stories, opening links, viewing profiles)
  • Events enable product insights — can build funnels: feed selection → story open → external link / discussion
  • Events include contextual properties (source, content_type, story_type)
  • No PII in event properties
  • 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