flagsmith
flagsmith copied to clipboard
Inconsistent empty feature values when creating or editing
How are you running Flagsmith
- [ ] Self Hosted with Docker
- [ ] Self Hosted with Kubernetes
- [X] SaaS at flagsmith.com
- [ ] Some other way (add details in description below)
Describe the bug
When a feature is created without a value, its value is set to null. However, if its value is set to non-empty and later set back to empty, the resulting value will be set to "". Setting the feature to have a value of null requires a manual API call.
Steps To Reproduce
- Create a feature without a value
- Click "Run test" in the Features list - that feature will have a value of
null - Edit the feature to have some other value
- Edit the feature again and delete its value
- Click "Run test" again - the feature will now have a value of
""
Expected behavior
Erasing a feature's value should return it to the exact same state as when it was created without a value. Because we're not making the type choice explicit in the UI, IMO the correct solution would be to always save empty features as null.
Screenshots
No response