Repository navigation
Bug 2079991 - When one update requests needinfo from several users , the webhook's 'event.changes' has a single 'flag.needinfo' entry for the last requestee only; the others are dropped. - #2777
Merged
Conversation
…the webhook's 'event.changes' has a single 'flag.needinfo' entry for the last requestee only; the others are dropped.
There was a problem hiding this comment.
🟡 Changes recommended
Positional pairing can incorrectly associate unrelated same-type flag changes.
1 open finding
What changed in this PR
Updates Push webhook flag handling so multiple same-type flag changes are preserved.
Changes:
- Emits one webhook change per flag update.
- Preserves multiple attachment flag changes and deduplicates routing-key fields.
- Adds regression tests for multi-requestee updates.
| File | Description |
|---|---|
extensions/Push/Extension.pm |
Restructures flag changes and routing keys. |
extensions/Push/t/flag_changes.t |
Tests multiple flag additions and removals. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ultiple changed flags' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Xzzz
approved these changes
Oct 12, 2026
Xzzz
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. Just two small things inline. Also maybe worth a line in docs/en/rst/extensions/Webhooks/index-user.rst saying that a field can appear more than once in changes.
Co-authored-by: Xavier L'Hour <xavier.lhour@gmail.com>
Co-authored-by: Xavier L'Hour <xavier.lhour@gmail.com>
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.

Sample webhook payloads
The
bugobject is trimmed toid,is_privateandflags. Real payloads carry the full bug.1. Needinfo requested from several users in one update (the bug being fixed)
Before this change,
event.changeshad a singleflag.needinfoentry, forbob@example.comonly. Now each requestee gets its own entry. The routing key still namesflag.needinfoonce.{ "bug": { "id": 1629704, "is_private": false, "flags": [ {"id": 101, "name": "needinfo", "value": "?", "requestee": {"id": 2, "login": "alice@example.com", "real_name": "Alice"}}, {"id": 102, "name": "needinfo", "value": "?", "requestee": {"id": 3, "login": "bob@example.com", "real_name": "Bob"}} ] }, "event": { "action": "modify", "routing_key": "bug.modify:flag.needinfo", "target": "bug", "time": "2026-10-10T20:11:22", "user": {"id": 1, "login": "carol@example.com", "real_name": "Carol"}, "changes": [ {"field": "flag.needinfo", "removed": "", "added": "? (alice@example.com)"}, {"field": "flag.needinfo", "removed": "", "added": "? (bob@example.com)"} ] }, "webhook_id": 23, "webhook_name": "test-bug" }2. A single flag changing state is still one change
There is one
reviewremoved and one added, so they are paired:? (alice)→+.{ "event": { "action": "modify", "routing_key": "bug.modify:flag.needinfo,flag.review", "target": "bug", "changes": [ {"field": "flag.needinfo", "removed": "", "added": "? (bob@example.com)"}, {"field": "flag.review", "removed": "? (alice@example.com)", "added": "+"} ] } }3. Several changes to one flag type are not paired
One update deletes Alice's needinfo, grants Bob's, and requests one from Dave. Which removal goes with which addition can't be known (a granted
+carries no requestee), so each is reported on its own instead of as made-up pairs like? (alice) → +.{ "event": { "action": "modify", "routing_key": "bug.modify:flag.needinfo", "target": "bug", "changes": [ {"field": "flag.needinfo", "removed": "? (alice@example.com)", "added": ""}, {"field": "flag.needinfo", "removed": "? (bob@example.com)", "added": ""}, {"field": "flag.needinfo", "removed": "", "added": "+"}, {"field": "flag.needinfo", "removed": "", "added": "? (dave@example.com)"} ] } }4. Attachment flags behave the same way
{ "bug": { "id": 1629704, "is_private": false, "attachment": {"id": 9001, "is_private": false, "file_name": "patch.diff"} }, "event": { "action": "modify", "routing_key": "attachment.modify:flag.review", "target": "attachment", "changes": [ {"field": "flag.review", "removed": "", "added": "? (bob@example.com)"}, {"field": "flag.review", "removed": "", "added": "? (dave@example.com)"} ] } }