flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

FLAG_UPDATE webhook shows incorrect states when removing segment override (and missing when versioning enabled)

Open gagantrivedi opened this issue 4 months ago • 0 comments

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

  1. FLAG_UPDATE should be triggered consistently for both versioning and non-versioning environments
  2. 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

gagantrivedi avatar Nov 04 '25 11:11 gagantrivedi