Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forcing variation with variable overrides #59

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

polok
Copy link
Contributor

@polok polok commented Jan 4, 2024

Background

Forcing:

The issue

When forcing a variation from rules, without forcing variables, the forced variation is not honored when evaluating its variables.

The fix

When evaluating variables, it will now check if there happens to be any forced variation.

If any forced variation, it will then honor the variation value before evaluating the variable values.

Otherwise, it will continue with its regular bucketing logic.

Note

The issue was spotted under JS SDK where Swift SDK follows it. As a reference featurevisor/featurevisor#236

@polok polok requested a review from a team as a code owner January 4, 2024 12:46
if let matchedAllocation = matchedTrafficAndAllocation.matchedAllocation {
var variationValue: VariationValue? = nil

if let forceVariation = force?.variation {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these lines are the fix

@polok polok merged commit 4b96ae7 into main Jan 4, 2024
1 check passed
@polok polok deleted the fix_force_variable_override branch January 4, 2024 17:02
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.

4 participants