craftcms / craftcms/webhooks

Two Requests Sent for Each Event

Open
#94 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
84
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Description

I have a very basic GET webhook set up to run for Entry elements on the afterSave event. While testing, when I save an entry and then look at the Webhooks plugin Activity panel, there are two requests where I expect to be just one. Similarly my recipient app logs two incoming requests. Both have 200 response statuses so it wasn't a retry (and even if it was I don't think retries log as separate requests). This also happens with POST requests.

Screenshot 2024-08-11 at 3 00 03 PM
Steps to reproduce
  1. Create a new webhook
  2. Set the element to craft\elements\Entry
  3. Set the event to afterSave
  4. Leave the Event Filters at default
  5. Leave Debounce Key Format blank
  6. Set request type to GET and set the webhook URL
  7. Leave Custom Headers blank
  8. Open an existing entry and save
Additional info
  • Craft version: 4.11.1
  • PHP version: 8.1.29
  • Database driver & version: MySQL 8.0.36
  • Plugins & versions:

Amazon S3 2.2.1
Asset Rev 7.0.0
CKEditor 3.8.3
Element API 4.1.0
Super Table 3.0.14
Webhooks 3.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using a Craft Entry webhook configured for the afterSave event, then compare the Webhooks plugin Activity panel with the recipient application's logs. Test both GET and POST requests and confirm the fix results in exactly one request per entry save, without duplicate activity records.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.