Flagsmith / Flagsmith/flagsmith
Improve clarity around `Project.hide_disabled_flags`
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 567
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 121
Description
Summary: The `Project.hide_disabled_flags` setting leads to confusing behavior in feature overrides.
## How to reproduce
This is similar to a recent case from a customer:
1. Set up a new feature "experience":
- `state=true`
- `value="standard"`
- 25% `value="beta"` (rolling out a new experience as an AB test)
2. Set up a new segment "acme_users".
- Matching trait `email` REGEX `[^@]+@acme\.com`.
- Override `experience` to
- `state=false` (**the default state when creating the override in the UI**)
- 100% `value="beta"`
3. Set up a new identity.
- `identifier="someuser"`
- Traits: `email="someuser@acme.com"`
```sh
curl -I -X POST http://localhost:8000/api/v1/identities/ -H "X-Environment-Key: $key" -H "Content-Type: application/json" -d '{"identifier": "someuser", "traits": [{"trait_key": "email", "trait_value": "someuser@acme.com"}]}'
```
3. Set the project's `hide_disabled_flags` to `true`.
4. Retrieve evaluated features for identity `"someuser"`.
```sh
curl -I -X GET 'http://localhost:8000/api/v1/identities/?identifier=someuser' -H "X-Environment-Key: $key"
```
5. Verify the "experience" feature is **absent**, while the expected behavior was that evaluated features included `experience="beta"`, _assuming 100% of users will affect all within that segment_.
```http
HTTP/1.1 200 OK
Content-Type: application/json
{
"flags": [],
"identifier": "someuser",
"traits": [
{
"id": 1,
"trait_key": "email",
"trait_value": "someuser@acme.com",
"transient": false
}
]
}
```
## The problem
While the goal of the setting `hide_disabled_flags` is well explained in the Project Settings UI (screenshot below), it might still lead to confusing behavior when overriding environment features **values**.
An override similar to the following example would be invisible in the evaluated features for a matching identity.
## Proposed solution
Improve clarity in the UI in distinct moments:
1. When setting the `hide_disabled_flags` setting to `true` in the Project Settings page, the UI should warn that Flagsmith will also remove any overrides when their state is disabled, _regardless if the value is overridden or not_.
2. When creating a new override, and `Project.hide_disabled_flags` is `true`, the UI should warn that the override will be removed when the feature is disabled.
3. When editing a segment to add a feature override, consider leaving "Enabled" turned on by default, at least when `Project.hide_disabled_flags` is `true`. This might be very relevant to scenarios such as A/B testing using overridden multivariate features (see "How to reproduce").
I believe this would prevent further confusion when users are trying to understand why their overrides are not being applied.
Contributor guide
Assessment
This issue has not been assessed yet.