fix: Flagsmith Environment Webhook incorrect payload values#6646
Merged
fix: Flagsmith Environment Webhook incorrect payload values#6646
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Contributor
Docker builds report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6646 +/- ##
==========================================
+ Coverage 98.18% 98.20% +0.01%
==========================================
Files 1294 1298 +4
Lines 46994 47108 +114
==========================================
+ Hits 46141 46262 +121
+ Misses 853 846 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
emyller
requested changes
Feb 2, 2026
Contributor
emyller
left a comment
There was a problem hiding this comment.
Looks solid! I have comments about the implementation, and non-blocking suggestions in tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to #6050, #5790.
In this PR, we fix incorrect webhook payloads when updating segment overrides (#6050). The root cause was that
drf-writable-nestedsavesFeatureStatebeforeFeatureStateValue, so webhooks triggered onpost_savecaptured stale values.This is a step toward #5790 (centralising webhook logic), but further work remains. The webhook infrastructure still has multiple layers (
webhooks/webhooks.py,features/tasks.py,audit/signals.py) that could be unified into a single, consistent system.post_savesignal handler fromFeatureStatethat triggered webhooks prematurelyFLAG_UPDATEDwebhooks via thefeature_state_change_went_livesignal, which fires after AuditLog creation when all nested objects are savedFeatureStateandFeatureStateValueaudit logs, since value-only changes also need to trigger webhooksFeatureStateis now the sender (matching the signal name), withAuditLogas a supplemental kwargHow did you test this code?
Added an integration test reproducing #6050, and various unit tests supporting the fix.