Skip to content

Flagsmith doesn't use boolean defaults and uses enablement status instead of flag value #1025

Open
@uriell

Description

@uriell

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: #1026

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions