Skip to content

Refactor Flipper gate precedence and semantics to match Ruby implementation#44

Merged
jonmagic merged 9 commits intomainfrom
fix/actors-vs-percentage-of-actors
Jan 4, 2026
Merged

Refactor Flipper gate precedence and semantics to match Ruby implementation#44
jonmagic merged 9 commits intomainfrom
fix/actors-vs-percentage-of-actors

Conversation

@jonmagic
Copy link
Collaborator

@jonmagic jonmagic commented Jan 4, 2026

Why?

Flipper typescript gate evaluation previously did not match Flipper Ruby's precedence order, causing discrepancies in which gates took priority for feature toggling. Percentage-of-actors bucketing differed from Ruby, expression gates didn't evaluate against actor properties, numeric gates and expressions did not disable other gates correctly, and actors with missing IDs weren't closed consistently. This led to nondeterministic toggling, inconsistent feature state, and difficulty asserting correct behavior across platforms.

How?

  • Reorder gate evaluation to apply percentage-of-time before group, matching Ruby's precedence (with added regression tests).
  • Update percentage-of-actors bucketing logic to align with Ruby implementation.
  • Ensure expressions evaluate against actor properties and properly disable without clearing other gates.
  • Treat actors with missing IDs as closed, and disable numeric gates and expressions without interfering with other gates.
  • Remove obsolete parity documentation to reduce clutter and clarify current documentation needs.

Reorders gate evaluation so percentage-of-time is checked before group, aligning with Ruby Flipper's precedence. Adds regression test asserting the winning gate via instrumentation.
Delete GATE_PRECEDENCE_PARITY_PLAN.md which detailed the plan for
aligning gate precedence and semantics between the Ruby and TypeScript
implementations. This file is no longer needed as all listed
parity gaps have been completed. Reduces clutter and clarifies
the project's current documentation needs.
@jonmagic jonmagic merged commit e2193d3 into main Jan 4, 2026
@jonmagic jonmagic deleted the fix/actors-vs-percentage-of-actors branch January 4, 2026 21:15
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