Repository navigation
Conversation
eli-r-ph
marked this pull request as ready for review
October 10, 2026 17:11
4 of 5 tasks
…xception properties
An invalid caller uuid is still replaced with a generated UUIDv7, but the SDK now logs one warning that names the rule instead of an error that echoes the value. An empty string counts as unset and gets a generated uuid without a log. Client and AsyncClient share one helper.
A disable_geoip argument now fills $geoip_disable as the event's own value: above context tags, super_properties and the client setting, and below a $geoip_disable in the call's properties. disable_geoip=False now sends $geoip_disable: false. Client and AsyncClient share the layer in _build_event_defaults.
eli-r-ph
force-pushed
the
v1-sync-main
branch
from
October 10, 2026 23:35
5f2f116 to
b4e9c49
Compare
eli-r-ph
force-pushed
the
v1-capture-api-fixes
branch
from
October 10, 2026 23:35
6982671 to
0c99129
Compare
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
Five fixes for the 8.0 major, one commit each:
request.postandrequest.flagsarguments. Removinggzipshifted the parameters after it. A 7.x call such aspost(key, host, path, True)then settimeout=True(1 second) with no error. The parameters afterpath(post) and afterhost(flags) are now keyword-only, so such a call raisesTypeError.capture_exception(level=...)and reserved exception properties. 8.0 is the major that feat(error-tracking): standardize exception event metadata #898's deprecation promised.propertiescan no longer override the 14 reserved exception properties; clashing keys are dropped.level=keyword onClient,AsyncPosthogand the module function sets$exception_level. It is normalized like integration levels, and an unknown value falls back toerror. An integration's level wins overlevel=.AsyncPosthog.capture_exceptionnow sends$exception_level, which it never did before..level().propertiesare checked. A reserved key in context tags orsuper_propertiesstill fills in when the call leaves it unset.$session_idor$window_idis dropped. It logs one warning per drop, naming the key and the JSON type, never the value.Nonestays silent and""is still sent. This matches posthog-go and posthog-rs.uuid: one warning that never includes the value. An invalid calleruuidis still replaced with a generated UUIDv7. Before, the SDK logged this at error level with the caller's value in the message, and callers can put their own data in that field. It now logs one warning that names the rule only. A missing or emptyuuidis generated silently, as a service, souuid=""no longer logs.ClientandAsyncPosthognow share one helper for this instead of two copies.disable_geoipis a value of that event. Before, the call argument fell back to the client setting and sat below context tags andsuper_properties, anddisable_geoip=Falsesent nothing. Now an explicitdisable_geoip=TrueorFalsefills$geoip_disableabove context tags andsuper_properties. A$geoip_disablein the call's ownpropertiesstill wins over it.Falseis sent as$geoip_disable: false, so one call can turn GeoIP lookup back on when a context tag orsuper_propertiesturns it off. The client'sdisable_geoipsetting keeps its place below every caller value.The migration guide and five changesets cover all of them.
💚 How did you test it?
level.Noneand an""that is sent.uuidvalues (string and non-string) log exactly one warning without the value, on sync and async; empty and missinguuidlog nothing.disable_geoip: call beats context, call beatssuper_properties,Falsebeatssuper_propertiesand the client setting, and an event property beats the call. It runs on sync and async.ruff format --check,ruff check, mypy with the baseline filter,make public_api_check, andpytest --timeout=30(4603 passed) all pass. Each commit passesmake public_api_checkon its own.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Cursor (Claude Opus 5.5). The reviewer decided the behavior: keyword-only arguments, the option A enforcement of exception metadata, a warning on every session id drop with
Nonesilent, the uuid rule (replace an invalid value with a warning, generate a missing or empty one silently), and the per-calldisable_geoipprecedence with an explicitfalseon the wire. The agent implemented it and checked it against the 7.x code onmainand against posthog-go and posthog-rs.A related change, making the AI integrations require
capture_aion a custom client, is stacked on this one in #1048 to keep this PR focused.