flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Errors when saving feature metadata fields are silently ignored

Open rolodato opened this issue 1 year ago • 2 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 saving any of these changes to metadata in a feature, no error is shown and the changes are not persisted after refreshing the page:

  • Erasing a required field and leaving it blank
  • Setting an int field to a string
  • Setting a URL field to an invalid URL

Steps To Reproduce

  1. Create a required feature metadata field
  2. Create a feature and provide the required field
  3. Edit the feature, and remove the value for the metadata field
  4. Changes are saved, but after you refresh the page the old value is still there

Expected behavior

Users should not be allowed to save changes to features that have invalid metadata fields (invalid type or missing value on a required field).

Screenshots

https://github.com/Flagsmith/flagsmith/assets/829698/d88435a4-7141-4dd1-a612-ffa32fd8bc27

rolodato avatar Jul 08 '24 15:07 rolodato

@novakzaballa This wasn't fully fixed by https://github.com/Flagsmith/flagsmith/pull/4327 - there's a bug still when trying to save required fields without providing a value:

https://github.com/user-attachments/assets/43650c6e-3c47-420c-b227-6291b9e952dd

Possibly the easiest way to solve this would be to have the validations for fields be checked on input for the field, and not when the field is unfocused. Let me know if I can clarify anything else on this.

rolodato avatar Jul 31 '24 16:07 rolodato

@novakzaballa This wasn't fully fixed by #4327 - there's a bug still when trying to save required fields without providing a value:

Possibly the easiest way to solve this would be to have the validations for fields be checked on input for the field, and not when the field is unfocused. Let me know if I can clarify anything else on this.

Hey @rolodato, I'll take a look at it. Thanks for the feedback.

novakzaballa avatar Jul 31 '24 17:07 novakzaballa