Repository navigation
fix: correlate capture results for non-canonical event uuids - #358
Merged
Merged
Conversation
Merged
3 of 5 tasks
Contributor
Author
|
Quick parity fix for this compared to other core backend SDKs I'm prepping for v1 release |
eli-r-ph
marked this pull request as ready for review
October 6, 2026 21:34
dustinbyrne
approved these changes
Oct 6, 2026
dustinbyrne
left a comment
Contributor
There was a problem hiding this comment.
The UUID correlation fix looks correct. The malformed-wrapper fallback note below is non-blocking.
AI-assisted review.
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
The capture v1 endpoint parses each event uuid leniently (uppercase, no hyphens, braced,
urn:uuid:), but keys the 200resultsmap by the canonical lowercase hyphenated form (response.rs).makeUUIDvalidated a caller-supplied uuid but returned it unchanged, andpartitionResultslooks results up by the exact string sent. For a non-canonical uuid the lookup missed, so the event was treated as accepted: aretrywas never retried, adropnever reachedCallback.Failure, and no success callback fired either.makeUUIDnow returns the canonical form of a valid caller-supplied uuid.prepareForSendcanonicalizes the correlation key, becauseBeforeSendruns aftermakeUUIDand may set any uuid form.posthog-rs is not affected: its event uuid is a typed
Uuid, which always serializes canonically.💚 How did you test it?
TestSendCorrelatesNonCanonicalUuidsends uppercase, unhyphenated, braced andurn:uuid:uuids to a test server that keysdropresults canonically, and asserts the failure callback fires. It fails without the fix.TestGeneratedUUIDsAreV7asserts caller-supplied uuids are canonicalized.go test ./...passes exceptTestOpenMachOUniversal, which also fails on unmodifiedv1on my machine (macOS debug-image fixture).📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Cursor (Claude Opus) under the direction of the assignee. Found while aligning posthog-python's capture v1 result handling with this branch. "Missing from results means accepted" stays as is: with canonical keys, a 2xx always has an entry per event, so that branch only matters if the server breaks its contract.