Repository navigation
chore: deprecate PostHogDataMode.cellular - #891
Conversation
PostHogDataMode.cellular has always behaved the same as .any: the queue only pauses when there is no connection, or when dataMode is .wifi and the device isn't on Wi-Fi. Deprecate it in favor of .any ahead of its removal in 4.0. The SDK never references it, so this adds no warnings to the SDK build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
posthog-ios Compliance ReportDate: 2026-10-01 23:13:51 UTC
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 2942ms |
| Format Validation.Event Has Uuid | ✅ | 3062ms |
| Format Validation.Event Has Lib Properties | ✅ | 494ms |
| Format Validation.Distinct Id Is String | ✅ | 667ms |
| Format Validation.Token Is Present | ✅ | 3024ms |
| Format Validation.Custom Properties Preserved | ✅ | 2962ms |
| Format Validation.Event Has Timestamp | ✅ | 2995ms |
| Retry Behavior.Retries On 503 | ✅ | 11837ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 4966ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 4960ms |
| Retry Behavior.Respects Retry After Header | ✅ | 7778ms |
| Retry Behavior.Implements Backoff | ✅ | 15439ms |
| Retry Behavior.Retries On 500 | ✅ | 9254ms |
| Retry Behavior.Retries On 502 | ✅ | 9447ms |
| Retry Behavior.Retries On 504 | ✅ | 5696ms |
| Retry Behavior.Max Retries Respected | ❌ | 21729ms |
| Deduplication.Generates Unique Uuids | ✅ | 3303ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 9292ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 16721ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 8115ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 3189ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 3199ms |
| Compression.Sends Gzip When Enabled | ✅ | 2900ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 2903ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 432ms |
| Batch Format.Multiple Events Batched Together | ✅ | 3164ms |
| Error Handling.Does Not Retry On 403 | ✅ | 5015ms |
| Error Handling.Does Not Retry On 413 | ✅ | 5088ms |
| Error Handling.Retries On 408 | ✅ | 9371ms |
Failures
retry_behavior.max_retries_respected
Expected 4 requests, got 6
Feature_Flags Tests
✅ 16/16 tests passed
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 2993ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 2984ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 2977ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 2899ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 2873ms |
| Request Payload.Groups Round Trip | ✅ | 2934ms |
| Request Payload.Groups Default To Empty Object | ✅ | 3027ms |
| Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It | ✅ | 2976ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 2913ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 3120ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 3121ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 198ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 3382ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 5809ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 2909ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 3075ms |
|
should we fix this isntead of deprecating? that we only flush data in |
|
@marandaneto I thought about making For context, If we implemented it now, anyone who set |
dustinbyrne
left a comment
There was a problem hiding this comment.
Review recommendation: approve. The existing enum case, raw values and default remain intact, and the queue handles .cellular and .any equivalently. The deprecation provides a clear migration without changing runtime behavior. 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
PostHogDataMode.cellularhas never done anything different from.any, so this deprecates it ahead of removing it in 4.0.dataModeis only read inPostHogQueue.updatePauseState. The queue pauses when there is no connection, or whendataMode == .wifiand the device isn't on Wi-Fi. Every other case sends, so.cellularfalls through exactly like.any..any.Nothing changes at runtime. Anyone using
.cellularcan switch to.anyand get identical behavior.Migration: replace
.cellularwith.any(PostHogDataModeCellularwithPostHogDataModeAnyin Objective-C).Changes:
@available(*, deprecated, ...)onPostHogDataMode.cellular, with a message pointing to.any.PostHogConfig.dataModeupdated to match.posthog-iosminor.Notes:
PostHogDataMode.cellular, so the attribute adds no warnings to the SDK build.Reachability.Connection.cellularand$network_cellularare separate and untouched.@objcenum cases in the generated header (PostHogDataModeCellular = 1is emitted with no deprecation macro). The header still carries the updated doc comment.posthog-flutter follow-up: posthog-flutter exposes
PostHogDataMode { wifi, cellular, any }(Apple only), and its plugin maps"cellular"toconfig.dataMode = .cellularinPosthogFlutterPlugin.swift. That line will produce a deprecation warning once posthog-flutter picks up this release. The fix is to map"cellular"to.anyin the plugin, which keeps the Dart API unchanged (no breaking change for Flutter), and to correct the Dart doc comment. That goes in a separate posthog-flutter PR.💚 How did you test it?
make test: passed (XCTest: 174 tests, 0 failures; Swift Testing: 919 tests in 148 suites)make buildSdk: succeeded for iOS, macOS, tvOS, watchOS and visionOS, with no new warningsmake apiCheck: snapshot up to date (no diff).PostHog-Swift.h:PostHogDataModeWifi = 0,PostHogDataModeCellular = 1,PostHogDataModeAny = 2, and no new warnings fromPostHog/sources.dataModedefault check inPostHogConfigTest.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code made the change, ran
make format,make test,make buildSdkandmake apiCheck, and checked the generated Objective-C header. The deprecation message follows the existing "This will be removed in the next major version." wording used elsewhere in the SDK. The removal for 4.0 is a separate PR on the 4.0 stack.🤖 Generated with Claude Code