Skip to content

[CI] (6fb03e7) react-native/expo-react-native-hacker-news#1479

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-6fb03e7-react-native-expo-react-native-hacker-news
Closed

[CI] (6fb03e7) react-native/expo-react-native-hacker-news#1479
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-6fb03e7-react-native-expo-react-native-hacker-news

Conversation

@wizard-ci-bot
Copy link
Copy Markdown

@wizard-ci-bot wizard-ci-bot Bot commented May 13, 2026

Automated wizard CI run

Source: scheduled
Trigger ID: 6fb03e7
App: react-native/expo-react-native-hacker-news
App directory: apps/react-native/expo-react-native-hacker-news
Workbench branch: wizard-ci-6fb03e7-react-native-expo-react-native-hacker-news
Wizard branch: main
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-05-13T17:36:16.601Z
Duration: 449.5s

@wizard-ci-bot
Copy link
Copy Markdown
Author

wizard-ci-bot Bot commented May 13, 2026

PR Evaluation Report

Summary

This PR integrates PostHog analytics into an Expo React Native Hacker News client app. It adds the posthog-react-native SDK, creates a client singleton loaded from environment variables via expo-constants, wraps the app in PostHogProvider, adds manual screen tracking, and instruments 7 meaningful user action events across 4 component files.

Files changed Lines added Lines removed
10 +199 -24

Confidence score: 4/5 👍

  • No error tracking: No captureException, error boundary, or exception autocapture configured. This is a gap in observability for a React Native app. [MEDIUM]
  • No .env.example file: Environment variables POSTHOG_PROJECT_TOKEN and POSTHOG_HOST are referenced but not documented in an .env.example or equivalent committed file. [MEDIUM]
  • Unsafe new URL() calls: new URL(url).host in Post.tsx and [itemId].tsx will throw if url is malformed — no try/catch protection. [MEDIUM]

File changes

Filename Score Description
lib/posthog.ts 4/5 PostHog singleton with env-based config and graceful no-op when unconfigured
app/_layout.tsx 4/5 Wraps app in PostHogProvider, adds manual screen tracking via usePathname
app/[itemId].tsx 3/5 Adds 3 event captures; new URL() call could throw on malformed URLs
components/posts/Post.tsx 3/5 Adds 4 event captures; same new URL() risk
components/comments/comment.tsx 5/5 Clean user_profile_viewed capture in press handler
components/Select.tsx 5/5 Tracks story type filter changes with good properties
app.config.js 5/5 Exposes env vars via Constants.expoConfig.extra
package.json 5/5 Adds posthog-react-native and required Expo peer deps
.gitignore 5/5 Adds .env to gitignore
posthog-setup-report.md 4/5 Wizard report — informational, not code

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Dependencies and imports are correct for Expo/React Native
Preserves existing env vars & configs Yes Existing app.json is extended via app.config.js, no configs deleted
No syntax or type errors Yes Code is syntactically valid; TypeScript types handled correctly
Correct imports/exports Yes All imports from posthog-react-native and expo-constants are correct
Minimal, focused changes Yes All changes are PostHog-related; peer deps (expo-application, expo-device, expo-file-system, expo-localization) are required by posthog-react-native
Pre-existing issues None

Issues

  • Unsafe new URL() parsing: In Post.tsx and [itemId].tsx, new URL(url).host is called without a try/catch. If url is malformed (e.g., a relative path or a text: scheme), this will throw and crash the press handler. Wrap in try/catch or use optional chaining with a fallback. [MEDIUM]
  • No .env.example: The app requires POSTHOG_PROJECT_TOKEN and POSTHOG_HOST env vars, but no .env.example file was created. Developers cloning the repo won't know what env vars to set. [MEDIUM]

Other completed criteria

  • All changes are relevant to PostHog integration
  • Correct files modified for Expo React Native architecture
  • Code follows existing codebase patterns (press handlers, component structure)
  • .env added to .gitignore to prevent secret leakage

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-react-native@^4.45.5 added with required peer deps
PostHog client initialized Yes Singleton in lib/posthog.ts using new PostHog(apiKey, { host, ... }) with PostHogProvider in _layout.tsx
capture() Yes 7 distinct events across 4 files with enriched properties
identify() N/A App is a read-only Hacker News reader with no authentication
Error tracking No No captureException(), no error boundary, no exception autocapture configured
Reverse proxy N/A React Native mobile app — reverse proxy not applicable

Issues

  • No error tracking: The integration does not set up any form of error tracking. For a React Native app, captureException could be called in error boundaries or a global error handler. The PostHogProvider autocapture config does not enable exception capture. [MEDIUM]

Other completed criteria

  • API key loaded from environment variable via expo-constants — not hardcoded
  • Host correctly configured from environment variable
  • Manual screen tracking via posthog.screen() on route changes using usePathname
  • captureAppLifecycleEvents: true enabled for app lifecycle tracking
  • Touch autocapture enabled (captureTouches: true)
  • Graceful no-op when PostHog is not configured (disabled mode with dev warning)

PostHog insights and events ✅

Filename PostHog events Description
components/posts/Post.tsx post_clicked, external_link_opened, comments_opened Tracks post interactions: title taps (internal vs external), comment button taps, and link button taps
components/Select.tsx story_type_changed Tracks story filter changes with from/to values
app/[itemId].tsx user_profile_viewed, item_external_link_opened, comment_thread_navigated Tracks detail page interactions: profile views, external links, and parent navigation
components/comments/comment.tsx user_profile_viewed Tracks username taps from comment context
app/_layout.tsx screen (via posthog.screen()) Manual screen tracking on every route change with previous screen context

Issues

None — events are well-structured and actionable.

Other completed criteria

  • Events represent real user actions (post clicks, link opens, filter changes, navigation)
  • Events enable product insights (content engagement funnel, external link rate, story preferences)
  • All events include enriched properties (item_id, url, host, source, title, comment_count)
  • No PII in event properties — only public Hacker News usernames and URLs
  • Event names are descriptive and use consistent snake_case naming

Reviewed by wizard workbench PR evaluator

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