flagsmith
flagsmith copied to clipboard
FLAG_UPDATE webhook shows incorrect states when removing segment override (and missing when versioning enabled)
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_UPDATEwebhook is triggered ✅ -
Problem: Both
new_stateandprevious_statecontain the same data - the feature state that was removed
With versioning:
-
FLAG_UPDATEwebhook is not triggered at all ❌
Expected Behavior
-
FLAG_UPDATEshould 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_UPDATEis triggered when removing segment overrides in versioned environments - Populate
new_statewith the environment default feature state? - Populate
previous_statewith the segment override being removed