Skip to content

fix: Identity overrides silently lost during local evaluation - #240

Merged
khvn26 merged 1 commit into
mainfrom
fix/identity-override-collapse
Aug 14, 2026
Merged

fix: Identity overrides silently lost during local evaluation#240
khvn26 merged 1 commit into
mainfrom
fix/identity-override-collapse

Conversation

@khvn26

@khvn26 khvn26 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Closes #239.

How did you test this code?

Added a second identity override to tests/data/environment.json, and a unit test.

Flags._resolve_flag built its trimmed evaluation context by re-keying
segments on the SegmentContext `key` field. Identity-override segments
are all mapped with an empty `key`, so every one of them collided on ""
and only the last survived: identities other than the last one to
override a given feature fell back to the environment default.

Key the segment overrides index by the evaluation context's own segment
keys instead, so the trimmed context stays a faithful subset of the
environment and no re-keying happens at all. Identity-override segments
now also carry their unique key rather than an empty one.

beep boop
@khvn26
khvn26 requested a review from a team as a code owner August 14, 2026 14:03
@khvn26
khvn26 requested review from emyller and removed request for a team August 14, 2026 14:03
@matthewelwell
matthewelwell requested review from matthewelwell and removed request for emyller August 14, 2026 14:11
@khvn26
khvn26 merged commit 17e243b into main Aug 14, 2026
6 checks passed
@khvn26
khvn26 deleted the fix/identity-override-collapse branch August 14, 2026 18:34
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.

Local evaluation: _resolve_flag collapses all identity overrides for a feature into one

3 participants