fix: prevent duplicated queued webhooks#22602
fix: prevent duplicated queued webhooks#22602flegastelois wants to merge 2 commits intoglpi-project:11.0/bugfixesfrom
Conversation
|
I have some doubts that deduplication can be done so easily for webhooks, and I think there were similar issues experienced with notifications which led to deduplication being removed for them. I cannot say that the important update will always be the first one within a request or that it is the only one the user will want a webhook for. With your example:
Updating the content for the existing queued webhook may yield better results but I am not sure at the moment if that introduces other issues. I'd like to get other people's opinions. |
It seems to me that we have a deduplication mechanism on the email notification side (to avoid sending two emails to the same person for the same event). What you say is true: my change may not be the best approach, and I also realize that the body of the first webhook does not correctly reflect the state of the ticket (since there is no technician yet). Maybe adding an additional filter in the webhook would prevent the first trigger (for example, when the technician is not empty). We can close this PR if we don’t find a reliable solution, no problem. |
|
@cconard96 how it could be hard to add specific events such as "resolve ticket" or "assign technician" like done in classic notifications ? |
I think the global triggering of webhooks in |
|
For ticket's notifications, global "update" event and specific events exists, and it's not an issue as notification target a trigger. |
The event still exists, but the logic in Lines 1468 to 1502 in 9ea3c75 |
Checklist before requesting a review
Description
Prevent duplicate queued webhooks for the same webhook and the same item/event.
Example case:
set_solution_tech