js-sdk-contrib
js-sdk-contrib copied to clipboard
Flagsmith doesn't use boolean defaults and uses enablement status instead of flag value
Introduction
Hey team, we've began using Flagsmith in scenarios other than the most common or basic, specifically creating a boolean flag that can be overriden in certain cenarios for part of the clients based off a segment.
Basically the flag is usually a truthy value, but a segment override that will be edited over time may decrease the amount of clients that receive true
and will now get a false
value. Kinda like a soft phase-out of a feature.
While building that we noticed that the provider didn't take into account falsey default values in boolean flags, using a fixed truthy value in the code, and the evaluation for these boolean values was based off their existance/enablement, and not their actual value, preventing us from using these overrides that change the value, not the enabled status.
I took the liberty to aside from reporting this, also preparing a reproducible environment and a PR fix, but please feel free to discuss and opinate on the issue or solution.
Links
Reproducible Example: https://github.com/uriell/openfeature-flagsmith-boolean-issues Pull Request: https://github.com/open-feature/js-sdk-contrib/pull/1026