Repository navigation
docs(capture): place server feature flag properties in the merge order - #145
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
On server SDKs the `$feature/<key>` and `$active_feature_flags` properties from a flags snapshot or `send_feature_flags` are values the SDK adds: they fill only the keys the event's own properties, the request context and the SDK-level default properties left unset. posthog-python #1121 and posthog-go #392 converged on this order; posthog-node already merges flag properties under the caller's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: e0ba06c7-1754-4d6e-93e0-ecb28f62ea93
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.
Why
The
capturespec says server SDKs stamp$feature/<key>and$active_feature_flagsonto an event, but never says where those properties sit in the property merge order — the server bullet of Behavior step 4 does not list them at all. The one precedence requirement in the spec is client-only, and #143 keeps it that way, so nothing covers the server side.Two SDKs converged on the same order this week, which makes it a contract rather than an implementation detail.
Source changes
v1, so the call'sproperties, context tags andsuper_propertiesall win over them (matching 7.x).Properties, the request context andDefaultEventProperties.buildFlagEventProperties(...)before the event's ownpropertiesinpackages/node/src/client.ts, so the caller wins there too.Changes
capturerequirement Server SDKs add feature flag properties as defaults: on server SDKs the flag properties fill only the keys left unset by the event's own properties and, where the SDK has them, the ambient request context and the SDK-level default/super properties.$active_feature_flagsreplaces rather than merges, and the properties are stamped beforebefore_send.openspec/changes/archive/2026-10-25-server-flag-property-precedence/.openspec validate --specs --strictgives the same totals asmain(31 passed, 36 failed — all pre-existing long-requirement warnings), andcapturereports no errors beyond those warnings.Uncertain / left out
@serverscenarios of the release-identifier requirement (descriptive, asserting on the enqueued event) and are not tagged@sdk:server, because no adapter-backed harness run has verified them. Noacceptance/file changed.super_properties/DefaultEventPropertiesapply after the caller's properties; posthog-python 8.0 and posthog-go v2 reverse that, while posthog-dotnet and posthog-elixir still match the spec. That is a separate contract change and needs a human decision — see the open question indesign.md.SendFeatureFlagspath overwrites a value set on the event or in the request context, so it is non-conforming until v2. Tracked in posthog-go.Created with PostHog Desktop
🤖 Generated with Claude Code