Flagsmith / flagsmith

Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
4.77k stars 365 forks source link

Percentage Override Not Saved When Modifying Segments #4655

Open ezgishere opened 1 week ago

ezgishere commented 1 week ago

How are you running Flagsmith

Describe the bug

There's an issue in Flagsmith where percentage settings are not retained if you remove a segment and add a new one without saving changes in between.

The issue occurs when you remove and add a new segment without saving the changes after removing the initial segment. A screen recording has been attached for reference.

Steps To Reproduce

Steps to Reproduce:

  1. Remove an existing segment (e.g., experiment-users).
  2. Add a new segment (e.g., s1_experiment_users) and turn it on.
  3. Set the percentage for each variant (e.g., 20% for each).
  4. Click on "Update Segment Override."
  5. Navigate away and return to the flag settings.

Actual Behavior: All percentages revert to 0%, requiring manual re-entry of the desired values.

Expected behavior

Expected Behavior: The set percentages (20% for each variant) should be saved and reflected correctly.

Screenshots

https://github.com/user-attachments/assets/cecdfe78-f6db-45d0-81d3-6998fdc07ae1