Repository navigation
fix: fill feature flag properties below context tags and super properties - #1121
Merged
Merged
Conversation
…ties Flag properties from flags or send_feature_flags are values the SDK adds, so they now fill after the call's properties, context tags and super_properties, like $is_server and system properties. 7.x already let context tags and super_properties win over them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
turnipdabeets
approved these changes
Oct 23, 2026
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
On
v1, the feature flag properties fromflagsorsend_feature_flags($feature/<key>,$active_feature_flags) win over the same keys set in context tags orsuper_properties. That differs from every released SDK and from the rest of the v1 fleet:This change treats flag properties as SDK values, like
$is_serverand system properties: they fill only keys the call, context tags andsuper_propertiesleft unset. The call's ownpropertiesstill win over everything, so a caller can still set a$feature/<key>on one event.Client.captureandAsyncPosthogpass flag properties to the SDK-values layer instead of merging them into the call's properties.💚 How did you test it?
$feature/<key>from the call, a context tag orsuper_propertiesbeats the snapshot value, and with no caller value the snapshot fills it. The context andsuper_propertiescases fail without this change._enqueuecall now read the flag properties from its new argument.pytest posthog/test,ruff check,ruff format --check,mypyandmake public_api_checkpass locally.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored with Claude Code (Claude Opus 5.5), directed by @eli-r-ph. The precedence was checked in the code of posthog-python 7.x, posthog-go 1.x and v2, posthog-node 5.x, posthog-js, posthog-ios 3.x and 4.0, and posthog-rs.
🤖 Generated with Claude Code