Skip to content

[CI] (963eeb8) swift/hackers-ios - #3836

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-963eeb8-swift-hackers-ios
Closed

[CI] (963eeb8) swift/hackers-ios#3836
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-963eeb8-swift-hackers-ios

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 963eeb8
App: swift/hackers-ios
App directory: apps/swift/hackers-ios
Workbench branch: wizard-ci-963eeb8-swift-hackers-ios
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-03T18:44:35.087Z
Duration: 655.3s

YARA Scanner

✓ 151 tool calls scanned, 0 violations detected

No violations: ✓ 151 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into the Hackers iOS app (a Hacker News client). It adds the PostHog iOS SDK via Swift Package Manager, initializes it in the AppDelegate with error tracking auto-capture, and adds custom event captures for login, logout, onboarding, post navigation, and settings interactions. Configuration is read from Info.plist values substituted from Xcode build settings.

Files changed Lines added Lines removed
7 +99 -23

Confidence score: 5/5 🧙

  • Missing identify() call: The app has full authentication (login/logout) but never calls PostHogSDK.shared.identify() after successful login. All events remain anonymous even for logged-in users, defeating the purpose of user-level analytics. [CRITICAL]
  • Missing reset() on logout: The logout() function calls sessionService.unauthenticate() but never calls PostHogSDK.shared.reset(), so a subsequent user on the same device would inherit the previous user's anonymous session. [MEDIUM]
  • Most events lack properties: Only post_opened includes a property (post_id). Events like login_succeeded, logout_completed, login_opened, settings_opened, and onboarding_completed are bare captures with no contextual properties. [MEDIUM]

File changes

Filename Score Description
App/AppDelegate.swift 4/5 Adds PostHog initialization with config read from Info.plist, error tracking auto-capture enabled, good defensive guards
App/ContentView.swift 3/5 Extracts inline closures into named methods to add capture calls; missing identify on login and reset on logout
App/NavigationStore.swift 4/5 Adds capture calls for post_opened (with post_id), login_opened, settings_opened
Hackers-Info.plist 5/5 Adds POSTHOG_HOST and POSTHOG_PROJECT_TOKEN keys with build setting substitution
project.pbxproj 4/5 Correctly adds SPM dependency with all three required objects (PBXBuildFile, XCSwiftPackageProductDependency, XCRemoteSwiftPackageReference)
Package.resolved 5/5 Resolved to posthog-ios 3.71.4
.env.example 5/5 Documents required environment variables

App sanity check ✅

Criteria Result Description
App builds and runs Yes SPM dependency properly added, all imports valid, syntax correct
Preserves existing env vars & configs Yes Existing functionality preserved; inline closures refactored into named methods with identical behavior plus PostHog captures
No syntax or type errors Yes All Swift code is syntactically valid
Correct imports/exports Yes import PostHog used correctly in all files
Minimal, focused changes Yes All changes serve the PostHog integration
Pre-existing issues None

Issues

No issues.

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration valid — pbxproj properly updated with SPM references
  • No XcodeGen project.yml found, so direct pbxproj edits are appropriate

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-ios added via SPM, version 3.59.3+ (resolved 3.71.4)
PostHog client initialized Yes PostHogSDK.shared.setup(config) in AppDelegate.application(_:didFinishLaunchingWithOptions:) with token and host from Info.plist
capture() Yes 6 custom events: login_succeeded, logout_completed, onboarding_completed, post_opened, login_opened, settings_opened
identify() No App has authentication but never calls PostHogSDK.shared.identify() after login
Error tracking Yes config.errorTrackingConfig.autoCapture = true
Reverse proxy N/A iOS native app — not applicable

Issues

  • No identify() after login: The authenticate() method successfully logs the user in and captures login_succeeded, but never calls PostHogSDK.shared.identify(distinctId) with the user's ID or username. All events remain anonymous even for authenticated users. Fix: after successful authentication, call PostHogSDK.shared.identify(userId, userProperties: ["name": username]) using a stable user ID from the auth response. [CRITICAL]
  • No reset() on logout: The logout() method calls sessionService.unauthenticate() but does not call PostHogSDK.shared.reset(). This means that if another user logs in on the same device, their events may be associated with the previous user's anonymous session. Fix: add PostHogSDK.shared.reset() in the logout() function. [MEDIUM]

Other completed criteria

  • API key and host correctly configured via build settings → Info.plist substitution, which bakes values into the app binary (recommended iOS pattern)
  • Host set to https://us.i.posthog.com (valid PostHog US cloud endpoint)
  • Screen views autocaptured by default (captureScreenViews defaults to true in iOS SDK)
  • SPM package reference correctly structured with all three pbxproj objects (PBXBuildFile, XCSwiftPackageProductDependency, XCRemoteSwiftPackageReference)

PostHog insights and events ⚠️

Filename PostHog events Description
AppDelegate.swift errorTrackingConfig.autoCapture Enables automatic exception/crash tracking
ContentView.swift login_succeeded, logout_completed, onboarding_completed Tracks authentication lifecycle and onboarding completion
NavigationStore.swift post_opened, login_opened, settings_opened Tracks navigation actions; post_opened includes post_id property

Issues

  • Sparse event properties: Only post_opened includes a property (post_id). Events like login_succeeded could include login_method or user type, settings_opened could include source context, and onboarding_completed could include steps completed. Bare captures limit the analytical value of the data. [MEDIUM]

Other completed criteria

  • Events represent real user actions (login, logout, viewing posts, opening settings)
  • Events enable product insights — can build login→post_opened funnels, track onboarding completion rates
  • No PII in event properties
  • Event names are descriptive and follow consistent snake_case 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