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
fix: use invariant culture when stringifying property values for matching (#270)
* Use invariant culture when stringifying property values
Property values were stringified with the current culture during local
evaluation, so a numeric property like 3.14 rendered as "3,14" under
comma-decimal locales (e.g. de-DE). That made exact, icontains, regex,
and string comparisons diverge from the PostHog flags service, which
always stringifies numbers with an invariant format. Stringify with
Convert.ToString(value, CultureInfo.InvariantCulture) everywhere a
property value is compared as a string.
Generated-By: PostHog Code
Task-Id: bb15888a-04c4-4dc0-916e-793a0540ece3
* Address PR review feedback
Generated-By: PostHog Code
Task-Id: 1d912da7-63e6-4f96-a192-955cb104f698
* Extract invariant stringification into a shared helper
ToInvariantString centralizes the invariant-culture stringification
policy in PropertyFilterValue and applies it to IsPrefixOf and
IsSuffixOf, so starts_with and ends_with operators also match
locale-independently. TestCulture.Use scopes the current culture in
tests, replacing repeated try/finally blocks.
Generated-By: PostHog Code
Task-Id: 1d912da7-63e6-4f96-a192-955cb104f698
Use the invariant culture when stringifying property values for feature flag local evaluation. Numeric property values such as `3.14` now stringify as `"3.14"` regardless of the host locale, so `exact`, `icontains`, `starts_with`, `ends_with`, and regex matching behave the same way the PostHog flags service does on machines using comma-decimal cultures.
0 commit comments