-
Notifications
You must be signed in to change notification settings - Fork 468
fix: Flagsmith Environment Webhook incorrect payload values #6646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid! I have comments about the implementation, and non-blocking suggestions in tests.
emyller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.