Skip to content

docs: describe feature flag properties as values the SDK adds - #392

Merged
eli-r-ph merged 2 commits into
v1from
v1-flag-properties-guide
Oct 23, 2026
Merged

eli-r-ph merged 2 commits into
v1from
v1-flag-properties-guide

Conversation

@eli-r-ph

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

The v2 migration guide and the capture-v1-default changeset say feature flag properties ($feature/<key>, $active_feature_flags) win over the request context and DefaultEventProperties. The code does the opposite, and that is the intended order: flag properties are values the SDK adds, so the request context and DefaultEventProperties win over them, and the event's own Properties win over everything (posthog.go fills context and defaults before both flag paths; TestEventPropertyLayers pins it).

This order matches posthog-go 1.x, posthog-python and posthog-node, which all let context and default properties win over flag properties, and the client SDK order in PostHog/sdk-specs#143. posthog-python's v1 branch gets the same fix in PostHog/posthog-python#1121.

  • docs/migration-v2.md lists flag properties from a Flags snapshot or SendFeatureFlags with the other SDK-added values, which fill under the event, the request context and DefaultEventProperties.
  • The capture-v1-default changeset says the same.

💚 How did you test it?

Docs only. go test -run TestEventPropertyLayers passes and pins the described order.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file (edited the existing capture-v1-default changeset instead)

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Authored with Claude Code (Claude Opus 5.5), directed by @eli-r-ph.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph eli-r-ph self-assigned this Oct 23, 2026
@eli-r-ph
eli-r-ph marked this pull request as ready for review October 23, 2026 21:57
@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 23, 2026 21:57
Comment thread docs/migration-v2.md Outdated
Comment thread .changeset/capture-v1-default.md Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph
eli-r-ph merged commit c9ed9eb into v1 Oct 23, 2026
32 checks passed
@eli-r-ph
eli-r-ph deleted the v1-flag-properties-guide branch October 23, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants