flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Inconsistent empty feature values when creating or editing

Open rolodato opened this issue 1 year ago • 0 comments

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

  1. Create a feature without a value
  2. Click "Run test" in the Features list - that feature will have a value of null
  3. Edit the feature to have some other value
  4. Edit the feature again and delete its value
  5. 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

rolodato avatar Jun 19 '24 20:06 rolodato