Repository navigation
fix: print the empty and personal API key setup errors without debug - #996
turnipdabeets wants to merge 4 commits into
Conversation
posthog-ios Compliance ReportDate: 2026-10-31T02:29:18.713312+00:00 ✅ All Tests Passed!233/233 tests passed Capture_V1 Tests✅ 106/106 tests passed View Details
Capture_Ai_V1 Tests✅ 110/110 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
33a89c8 to
161f487
Compare
eli-r-ph
left a comment
There was a problem hiding this comment.
- The compliance check here runs harness 1.14.0 (214/219), because #989 doesn't include #938's harness bump (#988) yet. Updating #989 from #938 should rerun these on 1.26.0.
posthog-ios/docs/migration-3.x-to-4.0.md
Line 41 in 161f487
This PR prints the key error without debug, so this line can say it prints a warning, also without
debug.
|
|
||
| if config.projectToken.isEmpty { | ||
| hedgeLog("PostHog SDK will be disabled because projectToken is empty.") | ||
| hedgeLogWarning("PostHog SDK will be disabled because projectToken is empty.") |
There was a problem hiding this comment.
Could a test check that these two warnings print with debug off? Going back to hedgeLog would still pass CI today. An injectable printer like PostHogApi.printWarning would make it testable.
There was a problem hiding this comment.
Fixed in 74093d6 — added PostHogSDK.printWarning and a test that fails if either line goes back to hedgeLog.
dcb70b9 to
bda7086
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a6ac39c to
c76f612
Compare
dustinbyrne
left a comment
There was a problem hiding this comment.
Both setup-warning cases are covered, and the migration guide now matches the behavior. No issues found.
AI-assisted review.
… p3-996 # Conflicts: # .changeset/v4-capture-v1.md # docs/migration-3.x-to-4.0.md
💡 Motivation and Context
Follow-up to #989, agreed with the capture v1 spec author on sdk-specs#146: when
setupleaves the SDK disabled becauseprojectTokenis empty or a personal API key (phx_...), print the reason even withdebugoff. Otherwise the app silently sends nothing.PostHogSDK.printWarning, an internal hook that defaults tohedgeLogWarning, which already prints withoutdebug(it's used for the missing capture route warning).💚 How did you test it?
disabledSetupWarns, which injectsprintWarningand checks both warnings withdebugoff. It fails if either line goes back tohedgeLog.make test filter=disabledSetupWarns,make lintandmake buildSdkSpmpass.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file (updated the existingv4-major-releasechangeset)🤖 Agent context
Autonomy: Human-driven (agent-assisted)
🤖 Generated with Claude Code