Repository navigation
chore(ios): map PostHogDataMode.cellular to .any - #634
Conversation
posthog-ios 4.0 removes PostHogDataMode.cellular, which always behaved like .any. Map the Dart "cellular" value to .any in the plugin and deprecate PostHogDataMode.cellular in Dart.
|
[Medium risk] Deprecates a data mode enum value used in analytics configuration. The PR is not ready to merge as a posthog-ios 4.0 compatibility change because neither Apple dependency declaration permits 4.0. Reviews (1) · Last reviewed commit: "chore(ios): map PostHogDataMode.cellular..." |
| case "any", "cellular": | ||
| config.dataMode = .any |
There was a problem hiding this comment.
Version 4 remains excluded The new mapping removes the
.cellular reference, but the CocoaPods and Swift Package Manager dependencies both require posthog-ios versions below 4.0.0. Neither can select 4.0, so this change does not yet unblock it. Widen both dependency ranges and build against 4.0 to verify compatibility.
Knowledge Base Used: SDK configuration and platform integrations
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift
Line: 238-239
Comment:
**Version 4 remains excluded** The new mapping removes the `.cellular` reference, but the CocoaPods and Swift Package Manager dependencies both require posthog-ios versions below 4.0.0. Neither can select 4.0, so this change does not yet unblock it. Widen both dependency ranges and build against 4.0 to verify compatibility.
**Knowledge Base Used:** [SDK configuration and platform integrations](https://app.greptile.com/posthog-org-19734/-/custom-context/knowledge-base/posthog/posthog-flutter/-/docs/sdk-configuration-and-platforms.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
posthog-flutter Compliance ReportDate: 2026-10-02 16:15:29 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
dustinbyrne
left a comment
There was a problem hiding this comment.
Review recommendation: approve. Mapping both channel values to native .any preserves the existing queue policy, while retaining Dart enum and serialization compatibility. The current native dependency ranges correctly remain unchanged; adopting native 4.0 is separate work. No findings.
Static source review and existing CI only; no tests run locally. Human-driven, agent-assisted review.
dustinbyrne
left a comment
There was a problem hiding this comment.
Approved following the completed source review.
Human-driven, agent-assisted review.
💡 Motivation and Context
posthog-ios 4.0 removes
PostHogDataMode.cellular(PostHog/posthog-ios#890), and posthog-ios 3.x deprecates it (PostHog/posthog-ios#891), because it has always behaved exactly like.any. Our iOS/macOS plugin setsconfig.dataMode = .cellular, so it won't compile against posthog-ios 4.0.This PR unblocks posthog-ios 4.0 with no behavior change:
"cellular"string from Dart to.any, which is what.cellularalready did at runtime.PostHogDataMode.cellularin Dart is marked@Deprecated, with a corrected doc comment. The old one said "Send data only on cellular connections", which was never true. The value stays, so this isn't breaking. We can remove it in the next major.dataMode, so nothing changes there.isDeprecated: true), and there's a patch changeset.💚 How did you test it?
flutter analyzeandflutter testinposthog_flutter: no issues, all tests pass.flutter build ios --simulator --no-codesignandflutter build macosinexample: both build (against the current posthog-ios 3.x).scripts/check-api-dart.sh,dart format, andswiftformat --lint: clean.setupPostHog, so testing it would need a new seam.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code. We kept the Dart enum value and only deprecated it, so 5.x stays non-breaking.
🤖 Generated with Claude Code