Skip to content

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

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#134
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 logic
  • Fixed premature false return for ANY rules with no conditions but with sub-rules, which prevented sub-rule evaluation entirely

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)
  • Applied the fix
  • Verified all 270 tests pass after the fix (921 assertions)

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.

Also fixes premature false return for ANY rules with no conditions
but with sub-rules, which prevented sub-rule evaluation.

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:20
@Zaimwa9 Zaimwa9 requested review from emyller and removed request for a team May 7, 2026 08:20
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.

3 participants