Repository navigation
Conversation
Capture uses a session whose adapter never retries, so each connection try is an SDK attempt with its own attempt number and request timestamp. The hidden adapter retries reused a stale timestamp, which capture reads as clock skew. A raising before_send logs the event name and exception type, never the exception message; the traceback goes to debug. A non-dict return logs its type and drops the event. The migration guide lists all four legacy option properties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 corrects clock skew from each request's
PostHog-Request-Timestamp, so every physical send needs a fresh stamp.The capture session's HTTP adapter retried a failed connection up to twice inside one SDK attempt, reusing the stamped headers.
After slow connection failures, capture saw a stale timestamp and shifted every event in that request later by the time spent connecting.
A raising
before_sendhook was logged with its exception message, which can hold the data the hook was removing.The migration guide also listed three of the four legacy option properties.
Changes
forkand when socket options change, like the other sessions.POST. Only connection retries change.before_sendlogs one error line with the event name and exception type, and the traceback at debug level, inClientandAsyncPosthog.before_sendthat returns something other than a dict orNonelogs its type and drops the event.$product_tour_id, the one-connection-try-per-attempt change, and the new hook log.💚 How did you test it?
ruff format --check,ruff check, mypy with the baseline, and the full test suite pass.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code (Claude Opus 5.5,
claude-opus-5-5) under the direction of the assignee.The capture session reuses the flags session's no-retry builder rather than changing the general session, so non-capture requests keep their behavior.
🤖 Generated with Claude Code