Skip to content

feat: serve flag overrides while uninitialized and mark override evaluations in events#410

Draft
kinyoklion wants to merge 2 commits into
rlamb/sdk-2655/override-source-apifrom
rlamb/sdk-2655/client-override-wiring
Draft

feat: serve flag overrides while uninitialized and mark override evaluations in events#410
kinyoklion wants to merge 2 commits into
rlamb/sdk-2655/override-source-apifrom
rlamb/sdk-2655/client-override-wiring

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Completes the client-side behavior of the override system:

  • Not-initialized short-circuit: when the client has no data from LaunchDarkly, the per-key evaluation gate now consults the override layer before returning the caller's default. An overridden flag falls through to the store read, which serves it via the overlay — including prerequisite and segment resolution against the merged view. Non-overridden flags short-circuit exactly as before, and removing an override restores the short-circuit on the next evaluation. The check only executes on the not-Refreshed branch, so the initialized hot path is untouched.
  • AllFlagsState: when uninitialized but the override layer has entries, the state is built from the merged view — a valid state containing only the overridden flags — instead of invalid-empty. This mirrors the existing behavior of serving known-incomplete cached data as valid, and keeps overrides useful for bootstrap endpoints during an outage. With no overrides, the invalid-empty behavior is unchanged. (The spec doesn't prescribe this case; flagged as a decision.)
  • Events: the flag's override marker rides into FlagEventProperties for both top-level and prerequisite evaluations, which is what drives the events pipeline's separate override summary counters and its suppression of individual feature/debug events (feat: mark override evaluations in summary counters and suppress their individual events go-sdk-events#54).

Client-level tests cover the gate matrix (overridden vs. not, with removal), the AllFlagsState three-way branch, the event marker, the marked evaluation reason end-to-end, and flag-change notifications firing when overrides change on a running client.

go.mod points at pseudo-versions of the in-flight go-server-sdk-evaluation and go-sdk-events branches; those get pinned to real releases at the end of the series.

Based on #409.

SDK-2655

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.

1 participant