Repository navigation
fix: Include the big segments status on evaluation reasons when a flag fails to evaluate - #258
Merged
Merged
Conversation
… evaluations A malformed flag error that occurs after a big segment query no longer drops the big segments status from the reason.
keelerm84
marked this pull request as ready for review
November 9, 2026 18:16
jsonbailey
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inInputValidatingEvaluator, 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 mergedstate.bigSegmentsStatusonto the reason; theEvaluationExceptioncatch now does the same onEvalResult.error(...), aligning behavior with the Go SDK.Adds
EvaluatorBigSegmentTestcases where an earlier rule touches a big segment and a later rule is malformed, assertingBigSegmentsStatus(STALEorNOT_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.