You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to create some complex scenarios that require filtering variants based on multiple overrides matching, not based on any one of multiple overrides matching.
Default behavior could remain the same of course, but an option in the SDK to specify either per-call, per flag, or per-client that variant overrides should be implemented such that all must match.
/* Feature flag `allocation-policy` configured with these variants and overrides:Name Overrides Value ------------------ ------------------------------ ----------------default *none* nevercorp office=corp lowest-loadboston office=boston round-robinboston-managers office=boston, role=manager never Then we can expect this kind of result with the provided overrides:*/val unleash =Unleash.....overrideMatchingPolicy(OverrideMatchingPolicy.MATCH_ALL)
unleash.getVariant(
"allocation-policy",
mapOf("office" to "boston")
)
// Result: `round-robin`, it matched override `boston` but not `manager`,// so `never` is not a valid option here
unleash.getVariant(
"allocation-policy",
mapOf(
"office" to "boston",
"role" to "manager"
)
)
// Result: `never`, it matches both overrides `boston` and `manager`,// so it will always return `never`
unleash.getVariant("allocation-policy")
// Result: `lowest-load`, no overrides matched / provided
The text was updated successfully, but these errors were encountered:
Thanks so much for raising this! I think this would be a really nice feature to add.
Just to be clear here, from the description this sounds like this would be a property set on the SDK at startup which would force all variants to use the match_all behaviour. Would it break your use case if this was driven from configuration in the UI on a per variant basis? I want to say that should reduce the risk of different configurations on multiple SDKs and make this a little more flexible to use
Describe the feature request
We would like to create some complex scenarios that require filtering variants based on multiple overrides matching, not based on any one of multiple overrides matching.
Background
Significantly more detail and background available in previous discussion: https://github.com/orgs/Unleash/discussions/3224.
Solution suggestions
Default behavior could remain the same of course, but an option in the SDK to specify either per-call, per flag, or per-client that variant overrides should be implemented such that all must match.
The text was updated successfully, but these errors were encountered: