Repository navigation
fix: keep $lib and $lib_version on capture v1 events - #1036
Merged
Merged
Conversation
An event queued before an SDK upgrade keeps the version that captured it instead of getting the running version from PostHog-Sdk-Info.
Contributor
posthog-ios Compliance ReportDate: 2026-11-05T19:39:29.254171+00:00 ✅ All Tests Passed!234/234 tests passed Capture_V1 Tests✅ 106/106 tests passed View Details
Capture_Ai_V1 Tests✅ 111/111 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
This was referenced Nov 5, 2026
turnipdabeets
added a commit
to PostHog/posthog-flutter
that referenced
this pull request
Nov 5, 2026
posthog-ios keeps per-event $lib and $lib_version on capture v1 (PostHog/posthog-ios#1036), so iOS and macOS no longer drop them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dustinbyrne
approved these changes
Nov 5, 2026
This was referenced Nov 5, 2026
gewenyu99
added a commit
that referenced
this pull request
Nov 6, 2026
Rebuilt from MIGRATION.md on chore/v4-remove-deprecated, which dropped the SDK identity section (#1036) and added the isFeatureEnabled empty-variant note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gewenyu99
added a commit
that referenced
this pull request
Nov 11, 2026
* docs: add the generated SDK reference for 3.x Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs: add the generated SDK reference for 4.x (experimental) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs: regenerate the iOS references from the DocC archive The 4.x page and migration guide come from chore/v4-remove-deprecated (the 4.0 branch) with the capability tags and getting-started applied. Both still need to land there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the iOS references with deprecations and Swift-only symbols 3.x and 4.x now mark deprecated APIs and give same-titled overloads one heading. 4.x drops the Swift-obsoleted ObjC bridges, lists captureAi, alias(_:options:) and isFeatureEnabled(_:defaultValue:) under their capabilities, and installs with Swift Package Manager only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the iOS references from docs/capabilities.json The pages match the tag-based run, minus six empty Discussion headings that a discussion holding only the tag line left behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the iOS migration page from the current 4.0 guide Rebuilt from MIGRATION.md on chore/v4-remove-deprecated, which dropped the SDK identity section (#1036) and added the isFeatureEnabled empty-variant note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the iOS migration page from the current 4.0 guide Rebuilt from MIGRATION.md on chore/v4-remove-deprecated after its pre-release review fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the iOS 4.x page from chore/v4-remove-deprecated Picks up the branch's feature flag doc comment fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the references with the getting-started intro Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
💡 Motivation and Context
Capture v1 currently deletes
$lib/$lib_versionfrom each event before sending, and PostHog fills them from thePostHog-Sdk-Infoheader. That header carries the SDK version running at send time, so an event queued offline and sent after an app update gets the new version. 4.0 also sends events 3.x left on disk, so those get labeled 4.0.Per the capture v1 thread, we're keeping per-event
$lib/$lib_versionand having ingestion store them as sent. This PR stops deleting them incaptureV1JSON(PostHogApi.swift), so 4.0 sends them like 3.x did. They stay visible and changeable inbeforeSend.Until capture-rs stops overwriting them from the header, PostHog stores the same values as before this PR. The behavior changes once that backend change lands.
Docs: removed the breaking-change entry from the changeset and the "SDK identity" section and checklist line from
MIGRATION.md, since 3.x behavior is back.💚 How did you test it?
PostHogCaptureV1TestbuildsV1Bodynow checks a stored$lib_version: 1.0.0is sent as-is whilePostHog-Sdk-Infocarries the running version. The test mock server no longer fills$lib/$lib_versionfrom the header, so event assertions see what the SDK sent.event-shapes-batch.json: all 5 events now carry$lib/$lib_version.swift test: all pass except 13 App Group issues inPostHogStorageTest, which fail the same way on the base branch.make swiftFormatCheckclean;make swiftLintCheckhas no serious violations.📝 Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
$lib/$lib_versionat capture time, so no new injection point.🤖 Generated with Claude Code