Skip to content

feat(Flag Dependency): Evaluate flags that depend on other flags in local evaluation - #267

Open
linear-code[bot] wants to merge 2 commits into
mainfrom
linear/sdk-2-enable-flag-dependency-in-all-server-side-sdks-85ed
Open

linear-code[bot] wants to merge 2 commits into
mainfrom
linear/sdk-2-enable-flag-dependency-in-all-server-side-sdks-85ed

Conversation

@linear-code

@linear-code linear-code Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Local evaluation ignored Flag Dependency for identity flags. The SDK already uses flagsmith-flag-engine 11.1.1, which supports segment conditions on other flags ($.flags.<feature>.enabled). However, get_identity_flags resolves each flag lazily against a context that contains only the requested feature, so the engine never sees the flags that feature depends on. For example, a feature that should turn on when its prerequisite is enabled kept its default. In the shared engine test data, 11 of the 19 flag-dependency cases failed through this path.

Changes

  • Identity flags that depend on other flags, directly or transitively, now match the engine and Edge API when evaluated locally.
  • Circular dependencies report ERROR; code=CIRCULAR_DEPENDENCY, as in the engine.
  • Flags that don't depend on other flags keep the lazy fast path.
  • The SDK now runs engine-test-data v3.12.1 in CI, added as a git submodule at tests/engine_tests/engine-test-data.

Flag-dependent features are detected once per environment-document refresh. Reading one triggers a single full evaluation, at the same cost as all_flags(), and its results are cached for the rest of that Flags object. All 220 engine-test-data cases pass through the lazy get_flag path.

Merging this produces a minor release (6.4.0) through release-please, which needs a maintainer to merge the release PR.

Contributes to https://linear.app/flagsmith/issue/SDK-2/enable-flag-dependency-in-all-server-side-sdks

Review effort: 2/5

…ocal evaluation

Identity flags in local evaluation are resolved lazily against a context
trimmed to the requested feature, which hides the flags a segment
condition such as `$.flags.<feature>.enabled` depends on. Features
overridden by such segments are now resolved against the full context.

Contributes to https://linear.app/flagsmith/issue/SDK-2/enable-flag-dependency-in-all-server-side-sdks

Generated with [Linear](https://linear.app/flagsmith/agent-session/c423fe72-0914-42ca-8401-f6992464b081)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@linear-code
linear-code Bot requested a review from a team as a code owner October 21, 2026 16:33
@linear-code
linear-code Bot requested review from khvn26 and removed request for a team October 21, 2026 16:33
… lazy flags

Generated with [Linear](https://linear.app/flagsmith/agent-session/c423fe72-0914-42ca-8401-f6992464b081)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant