And the person properties passed into local evaluation are :
{
"personProperties": {
"latestBuildVersion": undefined,
"latestBuildVersionMajor": undefined,
"latestBuildVersionMinor": undefined,
"latestBuildVersionPatch": undefined
} as unknown as Record<string, string>
}
Since we stringify all of the undefined values, the above call returns true when it should return false because the property values are undefined and not the string undefined.
Changes
Add a NULL_VALUES_ALLOWED_OPERATORS array of operators that allow NULL/UNDEFINED values which is just is_not right now . Any other operator will fail if the overrideValue is null or undefined
Release info Sub-libraries affected
Bump level
[ ] Major
[x] Minor
[ ] Patch
Libraries affected
[ ] All of them
[ ] posthog-web
[x] posthog-node
[ ] posthog-react-native
Changelog notes
Local feature flag evaluation will return false for undefined or null property values.
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.