fix(feature flags) : Local evaluation : guard for null values when comparing person Properties #249
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.
Problem
The current behavior of stringifying
undefined
andnull
values to compare with operators can lead to invalid results in local evaluation.This causes local evaluation to return
true
, while the/decide
API does the right thing and returns false forundefined
values in these properties.Customer reported that local evaluation always evaluates a condition to true, when it should evaluate to false.
The conditions in question are :
And the person properties passed into local evaluation are :
Since we stringify all of the
undefined
values, the above call returnstrue
when it should returnfalse
because the property values are undefined and not the stringundefined
.Changes
Add a
NULL_VALUES_ALLOWED_OPERATORS
array of operators that allow NULL/UNDEFINED values which is justis_not
right now . Any other operator will fail if the overrideValue isnull
orundefined
Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes
undefined
ornull
property values.