Repository navigation
chore!: remove the v2 legacy queue migration for v4 - #875
turnipdabeets merged 3 commits into
Conversation
f28649d to
f4be34f
Compare
a93db4c to
c97ea7d
Compare
cb1fcb7 to
a3f2567
Compare
8c739c7 to
11a2791
Compare
posthog-ios Compliance ReportDate: 2026-10-06 22:16:32 UTC
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 2729ms |
| Format Validation.Event Has Uuid | ✅ | 2665ms |
| Format Validation.Event Has Lib Properties | ✅ | 247ms |
| Format Validation.Distinct Id Is String | ✅ | 2675ms |
| Format Validation.Token Is Present | ✅ | 2788ms |
| Format Validation.Custom Properties Preserved | ✅ | 2864ms |
| Format Validation.Event Has Timestamp | ✅ | 317ms |
| Retry Behavior.Retries On 503 | ✅ | 5328ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2384ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 4736ms |
| Retry Behavior.Respects Retry After Header | ✅ | 7686ms |
| Retry Behavior.Implements Backoff | ✅ | 21368ms |
| Retry Behavior.Retries On 500 | ✅ | 9450ms |
| Retry Behavior.Retries On 502 | ✅ | 9266ms |
| Retry Behavior.Retries On 504 | ✅ | 9233ms |
| Retry Behavior.Max Retries Respected | ❌ | 15402ms |
| Deduplication.Generates Unique Uuids | ✅ | 533ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 9168ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 16687ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 7915ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 2885ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 2915ms |
| Compression.Sends Gzip When Enabled | ✅ | 2653ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 401ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 332ms |
| Batch Format.Multiple Events Batched Together | ✅ | 2920ms |
| Error Handling.Does Not Retry On 403 | ✅ | 4797ms |
| Error Handling.Does Not Retry On 413 | ✅ | 4920ms |
| Error Handling.Retries On 408 | ✅ | 9302ms |
Failures
retry_behavior.max_retries_respected
Expected 4 requests, got 5
Feature_Flags Tests
✅ 16/16 tests passed
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 2791ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 2672ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 2817ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 2734ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 2902ms |
| Request Payload.Groups Round Trip | ✅ | 2660ms |
| Request Payload.Groups Default To Empty Object | ✅ | 2813ms |
| Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It | ✅ | 2823ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 2808ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 2739ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 2877ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 96ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 2770ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 5532ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 2906ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 3021ms |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Drop the top-level $set and message_id fallbacks in PostHogEvent.fromJSON. They only served events copied unchanged from the 2.x queue, whose import was removed in the previous commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
a3f2567 to
f585973
Compare
dustinbyrne
left a comment
There was a problem hiding this comment.
Looks good for the v4 retirement of legacy queue import and decoding. No blocking findings.
One non-blocking migration note: 3.x imported v2 records unchanged, so a 2→3→4 upgrade with undelivered imported records also loses root $set handling and generates fresh UUIDs when decoding message_id-only records. These are consequences of retiring the legacy format, not requests to retain it. Consider narrowing the changeset’s ‘Apps on any 3.x release are not affected’ wording to events created by 3.x.
No new downgrade crash issue identified. Existing startup smoke tests pass for 3.48.0, 3.48.3, and 3.58.0; this does not promise identical behavior or queue delivery after downgrade.
Agent-led review; conclusions discussed with and approved by @dustinbyrne before posting. The human considered migration intent and no-crash downgrade compatibility. Validation was static inspection and existing CI evidence; no tests were executed by the reviewer.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@dustinbyrne Thanks! Narrowed the changeset wording to events created by 3.x, and called out that pending 2.x events imported by 3.x lose the For sizing: over the last 7 days (US), 2.x is ~1% of iOS SDK users (~153K) and ~0.3% of events, across 79 apps — almost all on 2.1.0. 55 of those apps have never shipped 3.x. Only events still unsent on disk at the moment of a direct 2.x → 4.0 update are lost; identity is still migrated. |
* chore!: remove the v2 legacy queue migration for v4 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore!: stop reading the 2.x event format in queued events Drop the top-level $set and message_id fallbacks in PostHogEvent.fromJSON. They only served events copied unchanged from the 2.x queue, whose import was removed in the previous commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs: narrow the changeset to events created by 3.x Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore!: remove the v2 legacy queue migration for v4 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore!: stop reading the 2.x event format in queued events Drop the top-level $set and message_id fallbacks in PostHogEvent.fromJSON. They only served events copied unchanged from the 2.x queue, whose import was removed in the previous commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs: narrow the changeset to events created by 3.x Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
💡 Motivation and Context
Part of the 4.0 stack, on top of #873 (
chore/v4-remove-deprecated). It removes the migration of the event queue written by the 2.x Objective-C SDK.posthog.queue.plist, written only by SDK 2.x. No 3.x release writes it; 3.0.0 shipped in January 2024.migrateLegacyStorage, which this PR does not touch.Migrations that stay, because recent 3.x releases still depend on them:
posthog.queueFoldertoposthog.queueFolder.uuidposthog.replayFoldertoposthog.replayFolder.uuidmigrateLegacyStorage(bundle-ID folder to per-token folder)No public API change.
Cross-SDK note: posthog-android still has its equivalent legacy-queue import (
flushLegacyEvents). Thepersistent-storagesdk-spec asks SDKs to support migrations when storage layout changes but sets no retention period, so removing this one in a major is a mild divergence from Android.The second commit stops
PostHogEvent.fromJSONfrom reading the 2.x event fields (a top-level$setandmessage_id). Only events copied unchanged by the removed migration used them. An event in that format is still read and sent, but with a new UUID and without its top-level$set.💚 How did you test it?
make testpasses locally (910 tests, macOS), including a new test that a v2 queue file is deleted without importing its events.make apiCheckreports the snapshot up to date.make testpasses (912 Swift Testing tests, 167 XCTest), including two new tests that the 2.x fields are ignored anduuidis still read;make apiCheckreports the snapshot up to date.PostHogLogsQueueTests. Rerunning that suite three times failed 2 of 3 on this branch and 2 of 3 on the base commit, with different tests each time. The logs queue has no old storage keys and never reaches the changed line.PostHogExampleinstalled over it from the base commit and from this branch.posthog.queue.plistafter setupPostHogStorageTestseedsposthog.queue.plistin the legacy base folder, then buildsPostHogStorageand the events queue. It checks that the storage migration moves the file and the queue deletes it without importing anything.make testDowngradeCompatibility,make buildfor the other platforms.crypto, and 2.x on tvOS.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset fileThe changeset is
majorand was written by hand in the changeset format.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
migrateLegacyStoragewould otherwise keep moving it into the per-token folder, where onlyreset()would remove it.🤖 Generated with Claude Code