Description
There's an inconsistency in the FLAG_UPDATE webhook behavior when removing a segment override from an environment, with different problems depending on whether versioning is enabled.
Current Behavior
Without versioning:
FLAG_UPDATE webhook is triggered ✅
- Problem: Both
new_state and previous_state contain the same data - the feature state that was removed
With versioning:
FLAG_UPDATE webhook is not triggered at all ❌
Expected Behavior
FLAG_UPDATE should be triggered consistently for both versioning and non-versioning environments
- The webhook payload should accurately reflect the state change:
previous_state: The segment override that is being removed
new_state: The environment default feature state (which will now apply after the override is removed)
Proposed Solution
- Ensure
FLAG_UPDATE is triggered when removing segment overrides in versioned environments
- Populate
new_state with the environment default feature state?
- Populate
previous_state with the segment override being removed