Skip to content

feat: Add the overrideAffected indicator to EvaluationReason - #218

Draft
kinyoklion wants to merge 1 commit into
feat/overridesfrom
rlamb/overrides-java-common-reason-marker
Draft

kinyoklion wants to merge 1 commit into
feat/overridesfrom
rlamb/overrides-java-common-reason-marker

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

The OVERRIDE specification marks an evaluation as override-affected when any definition it read came from the SDK's override store: the flag itself, a prerequisite at any depth, or a segment consulted during matching. The evaluation reason carries that marking as a boolean indicator named overrideAffected, alongside inExperiment, so callers of the variation detail methods can tell such evaluations apart.

EvaluationReason gains isOverrideAffected() and withOverrideAffected(boolean). The latter returns the same instance when the value is unchanged, so the shared static instances stay shared. The indicator takes part in equality and hashing. The JSON representation writes overrideAffected only when it is true, and parsing accepts the property. The string representation is unchanged.

Flag overrides are currently experimental and subject to change. The server SDK change that sets the indicator depends on the release of this package.

SDK-3246


Note

Overview
Adds an experimental overrideAffected flag on EvaluationReason so variation-detail callers can see when an evaluation (or a prerequisite/segment it used) drew from the SDK override store.

EvaluationReason stores the boolean (default false), exposes isOverrideAffected() / withOverrideAffected(boolean) (identity-preserving when unchanged), and includes it in equals/hashCode without changing toString(). EvaluationReasonTypeAdapter reads overrideAffected from JSON and writes it only when true, matching inExperiment. Tests cover defaults, copying, equality, and JSON round-trips.

Reviewed by Cursor Bugbot for commit b5deba0. Bugbot is set up for automated code reviews on this repo. Configure here.

The OVERRIDE specification marks an evaluation as override-affected when
any definition it read came from the SDK's override store: the flag
itself, a prerequisite at any depth, or a segment consulted during
matching. The evaluation reason carries that marking as a boolean
indicator named overrideAffected, alongside inExperiment, so that
callers of the variation detail methods can tell such evaluations apart.

EvaluationReason gains isOverrideAffected() and withOverrideAffected(),
which returns the same instance when the value is unchanged so that the
shared static instances stay shared. The indicator takes part in
equality and hashing. The JSON representation writes overrideAffected
only when it is true, and parsing accepts the property.

Flag overrides are currently experimental and subject to change.
@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b5deba0. Configure here.

This branch has not been deployed

No deployments
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