Skip to content

fix: Include the big segments status on evaluation reasons when a flag fails to evaluate - #258

Merged
keelerm84 merged 1 commit into
mainfrom
mk/SDK-3520/big-segments-error-status
Nov 10, 2026
Merged

keelerm84 merged 1 commit into
mainfrom
mk/SDK-3520/big-segments-error-status

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

When a flag rule queried a big segment and a later clause made the flag fail to evaluate (for example, a clause with no attribute), the error reason dropped the big segments status. The evaluator applied the status only to successful results. A failed evaluation now carries the status on its error reason. This matches the Go SDK, which applies the status whether or not evaluation fails.

Unexpected exceptions are unchanged. They escape Evaluator.evaluate() and are handled in InputValidatingEvaluator, where the evaluator state is not available. Catching them inside the evaluator would also change how those failures are logged, which event path records them, and the flag returned with the result. Go has no equivalent case, because a panic is not recovered there either.


Note

Overview
Fixes big segments status being dropped when flag evaluation ends in an error after a big-segment query already ran (e.g. a later malformed clause). The success path in Evaluator.evaluate() already merged state.bigSegmentsStatus onto the reason; the EvaluationException catch now does the same on EvalResult.error(...), aligning behavior with the Go SDK.

Adds EvaluatorBigSegmentTest cases where an earlier rule touches a big segment and a later rule is malformed, asserting BigSegmentsStatus (STALE or NOT_CONFIGURED) remains on the error reason.

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

… evaluations

A malformed flag error that occurs after a big segment query no longer drops the big segments status from the reason.
@keelerm84
keelerm84 marked this pull request as ready for review November 9, 2026 18:16
@keelerm84
keelerm84 requested a review from a team as a code owner November 9, 2026 18:16
@keelerm84
keelerm84 merged commit ce08ae8 into main Nov 10, 2026
30 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3520/big-segments-error-status branch November 10, 2026 16:01
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