fix(flipt): Fix FliptProvider to honor server default variant when match is false#1776
Open
Openroads wants to merge 2 commits intoopen-feature:mainfrom
Open
fix(flipt): Fix FliptProvider to honor server default variant when match is false#1776Openroads wants to merge 2 commits intoopen-feature:mainfrom
Openroads wants to merge 2 commits intoopen-feature:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Flipt provider to support server-provided default variants. Previously, if a targeting match was not found, the provider would immediately return the SDK's default value. The logic now checks for a server-provided variant key even when a match is false, allowing the server's default configuration to take precedence. A review comment identifies that the evaluation reason should be updated to 'DEFAULT' in these cases to comply with the OpenFeature specification, as the current implementation would incorrectly report 'TARGETING_MATCH'.
d910fc3 to
282b001
Compare
added 2 commits
April 18, 2026 21:05
…ere is no match Signed-off-by: Dariusz Szyszlak <dariusz.szyszlak@gmail.com>
…o match but default variant is returned from the server Signed-off-by: Dariusz Szyszlak <dariusz.szyszlak@gmail.com>
282b001 to
2f67900
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR
Fixes Flipt variant evaluation fallback behavior so that the provider honors Flipt’s server-side default variant even when match=false. Previously, FliptProvider#evaluateVariant returned the OpenFeature SDK defaultValue whenever response.isMatch() was false, which caused the server-provided default variant (variantKey) to be ignored.
adds a unit test covering the match=false + variantKey (server default) scenario
Notes
The new test uses a mocked /evaluate/v1/variant response with match=false and a non-empty variantKey to validate the behavior.
How to test
Run and verify the new test passes:
getStringVariantEvaluation_usesServerDefaultVariantWhenNoMatch