Skip to content

fix: respect rule type for sub-rules in segment evaluation#213

Open
Zaimwa9 wants to merge 1 commit intomainfrom
feat/apply-top-rules-with-any-type
Open

fix: respect rule type for sub-rules in segment evaluation#213
Zaimwa9 wants to merge 1 commit intomainfrom
feat/apply-top-rules-with-any-type

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented May 7, 2026

Summary

  • Bumped engine-test-data submodule from v3.5.0 to v3.7.0
  • Fixed segment evaluation: sub-rules now respect the parent rule's type (ANY/ALL/NONE) instead of hardcoding ALL
  • Updated unit test expectation to match corrected behavior

Equivalent fix to flagsmith-engine#313.

Test plan

  • Bumped engine-test-data to v3.7.0 (includes new sub-rule type test cases)
  • Verified tests fail before the fix (2 failures from engine-test-data, then 1 from unit test)
  • Applied the fix to SegmentEvaluator.java
  • Updated SegmentEvaluatorTest.java to match corrected behavior
  • Verified all 403 tests pass after the fix

Sub-rules were always evaluated with ALL logic, ignoring the parent
rule's type field (ANY/ALL/NONE). Now uses type-aware matching for
sub-rules, matching the existing conditions behavior.

Bumps engine-test-data from v3.5.0 to v3.7.0 which includes test cases
for this fix.

Equivalent fix to flagsmith-engine#313.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Zaimwa9 Zaimwa9 requested a review from a team as a code owner May 7, 2026 08:26
@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for a team May 7, 2026 08:26
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