Skip to content

Flagsmith Environment Webhook incorrect payload values #6050

Description

@tomerplus500

How are you running Flagsmith

  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)

Describe the bug

Self hosted - Version 2.196.0

Feature segment override value provided by the webhook payload is incorrect (Enabled works as expected).
For example, I changed the segment override value from 48 to 49, clicked "Update Segment Overrides" and got back incorrect payload where prev values is 48 and new value is 48.

Steps To Reproduce

  1. Set an environment Webhook.
  2. Create a feature with one segment override
  3. Set segment override value to 0.
  4. Change the value from 0 to 1 and observe the JSON sent to the webhook.
  5. Clone the segment override view and open it again.
  6. Change the value from 1 to 2 and observe the JSON sent to the webhook.

Expected behavior

Expected to get the correct previous segment override value and the new segment override value.

Screenshots

Before update

Image

After update

Image

Webhook provided JSON

{
  "event_type": "FLAG_UPDATED",
  "data": {
    "changed_by": "admin@comp.com",
    "timestamp": "2025-09-11T12:37:39.823121Z",
    "previous_state": {
      "enabled": true,
      "environment": {
        "id": 1,
        "name": "Test"
      },
      "feature": {
        "id": 1,
        "name": "test",
        "description": null,
        "type": "STANDARD",
        "created_date": "2025-09-10T13:42:43.260047Z",
        "default_enabled": true,
        "initial_value": "5",
        "project": {
          "id": 1,
          "name": "Default Project"
        }
      },
      "feature_segment": {
        "priority": 0,
        "segment": {
          "id": 4,
          "name": "segment_1",
          "description": ""
        }
      },
      "feature_state_value": 45,
      "identity": null,
      "identity_identifier": null
    },
    "new_state": {
      "enabled": true,
      "environment": {
        "id": 1,
        "name": "Test"
      },
      "feature": {
        "id": 1,
        "name": "test",
        "description": null,
        "type": "STANDARD",
        "created_date": "2025-09-10T13:42:43.260047Z",
        "default_enabled": true,
        "initial_value": "5",
        "project": {
          "id": 1,
          "name": "Default Project"
        }
      },
      "feature_segment": {
        "priority": 0,
        "segment": {
          "id": 4,
          "name": "segment_1",
          "description": ""
        }
      },
      "feature_state_value": 30,
      "identity": null,
      "identity_identifier": null
    }
  }
}

Before update

Image

After update

Image

Webhook provided JSON

{
 "event_type": "FLAG_UPDATED",
 "data": {
   "changed_by": "admin@comp.com",
   "timestamp": "2025-09-11T12:41:55.262265Z",
   "previous_state": {
     "enabled": true,
     "environment": {
       "id": 1,
       "name": "Test"
     },
     "feature": {
       "id": 1,
       "name": "test",
       "description": null,
       "type": "STANDARD",
       "created_date": "2025-09-10T13:42:43.260047Z",
       "default_enabled": true,
       "initial_value": "5",
       "project": {
         "id": 1,
         "name": "Default Project"
       }
     },
     "feature_segment": {
       "priority": 0,
       "segment": {
         "id": 4,
         "name": "segment_1",
         "description": ""
       }
     },
     "feature_state_value": 30,
     "identity": null,
     "identity_identifier": null
   },
   "new_state": {
     "enabled": true,
     "environment": {
       "id": 1,
       "name": "Test"
     },
     "feature": {
       "id": 1,
       "name": "test",
       "description": null,
       "type": "STANDARD",
       "created_date": "2025-09-10T13:42:43.260047Z",
       "default_enabled": true,
       "initial_value": "5",
       "project": {
         "id": 1,
         "name": "Default Project"
       }
     },
     "feature_segment": {
       "priority": 0,
       "segment": {
         "id": 4,
         "name": "segment_1",
         "description": ""
       }
     },
     "feature_state_value": 45,
     "identity": null,
     "identity_identifier": null
   }
 }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions