Repository navigation
[CI] (0e81558) swift/hackers-ios - #4264
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
|
Now I have enough context. Let me produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Swift iOS app ("Hackers") by adding the posthog-ios SDK via SPM, initializing it in
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | SPM dependencies correctly wired in both local packages and xcodeproj; syntax is valid |
| Preserves existing env vars & configs | Yes | Existing code preserved; sign-in/sign-out logic refactored minimally to wrap with captures |
| No syntax or type errors | Yes | All Swift syntax appears valid; imports resolve correctly |
| Correct imports/exports | Yes | import PostHog added in all files that use the SDK |
| Minimal, focused changes | Yes | All changes relate to PostHog integration |
| Pre-existing issues | None | — |
Issues
captureLogAPI validity: ThePostHogAppLoggerhelper callsPostHogSDK.shared.captureLog(message, level: .info). This is part of the structured logs feature (documented in the SDK config aslogsconfig). If the feature is available in v3.85.2 it's fine, but the docs reference it under a separate "Logs installation" page. This is a minor concern. [LOW]
Other completed criteria
- All changes are relevant to PostHog integration
- Correct files modified for this iOS framework
- Code follows existing codebase patterns (naming, structure)
- Build configuration valid (Package.swift files, pbxproj properly structured)
PostHog implementation ❌
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-ios v3.59.3+ added via SPM in xcodeproj, Shared/Package.swift, and Settings/Package.swift; resolved to v3.85.2 |
| PostHog client initialized | No | Uses ProcessInfo.processInfo.environment exclusively — env vars are not injected in release builds, making PostHog non-functional in production |
| capture() | Yes | Multiple meaningful capture calls across the app |
| identify() | No | App has sign-in/sign-out but never calls identify() or reset() |
| Error tracking | Yes | config.errorTrackingConfig.autoCapture = true correctly enables automatic error capture |
| Reverse proxy | No | No reverse proxy configured for the PostHog host |
Issues
- Environment-variable-only initialization crashes or silently fails in production:
ProcessInfo.processInfo.environment["POSTHOG_PROJECT_TOKEN"]and["POSTHOG_HOST"]are only set when launching from Xcode (debug/simulator). In Archive/Release builds (TestFlight, App Store) these are empty, so theguardreturns early and PostHog is never initialized. Fix: Hardcode the project token and host directly inPostHogConfigas the primary source (this is the documented iOS pattern — the token is a public client-side key). Optionally read env vars as a debug override. [CRITICAL] - No user identification on login/logout:
signIn()capturessign_in_succeededbut never callsPostHogSDK.shared.identify(userId)with the authenticated user's ID.recordSignOut()capturessigned_outbut never callsPostHogSDK.shared.reset(). All events remain anonymous and cannot be attributed to users. Fix: CallPostHogSDK.shared.identify(username)after successful authentication andPostHogSDK.shared.reset()on logout. [CRITICAL] - No reverse proxy: Client-side PostHog traffic goes directly to
posthog.com, which is commonly blocked by ad/content blockers. Fix: Configure a reverse proxy endpoint and point the host to it. [MEDIUM]
Other completed criteria
- API host is configured (via the env var, when available)
- Error tracking correctly enabled with
autoCapture = true - SPM package references correctly structured in pbxproj (3 required objects present)
- Screen views: autocapture is enabled by default (
captureScreenViewsdefaults totrue)
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
AppDelegate.swift |
errorTrackingConfig.autoCapture, posthog_log_capture_configured |
Error auto-capture enabled; info log on setup |
ContentView.swift |
sign_in_succeeded, signed_out, onboarding_completed |
Auth and onboarding lifecycle events |
SupportViewModel.swift |
support_purchase_completed, purchases_restored |
IAP events with purchase_kind property |
BookmarksController.swift |
bookmark_added, bookmark_removed |
Bookmark toggle with post_id property |
VotingViewModel.swift |
post_upvoted, post_unvoted, comment_upvoted, comment_unvoted |
Voting events with post_id and comment_id properties |
Issues
- No issues with event quality — events are well-named, represent real user actions, and include relevant properties.
Other completed criteria
- Events represent real user actions (sign in, sign out, bookmark, vote, purchase)
- Events enable product insights (funnel from sign-in → onboarding → engagement)
- Events include contextual properties (post_id, comment_id, purchase_kind)
- No PII in event properties
- Consistent snake_case naming convention
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: wizard-pr
Trigger ID:
0e81558App:
swift/hackers-iosApp directory:
apps/swift/hackers-iosWorkbench branch:
wizard-ci-0e81558-swift-hackers-iosWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-29T08:49:14.652Z
Duration: 657.8s
YARA Scanner