[MGNLHOOK-261] Asset webhook fires twice Created: 24/Oct/22  Updated: 25/Apr/23  Resolved: 25/Apr/23

Status: Closed
Project: Magnolia Webhooks
Component/s: None
Affects Version/s: 1.0.0, 2.0.0
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Dai Ha
Resolution: Cannot Reproduce Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File AssetToPublish-6.2.33.png     PNG File AssetToPublish-6.3.png     PNG File Definition-6.3.png     PNG File Screen Shot 2022-10-20 at 9.42.49 PM.png     PNG File WHRequestReceived-6.2.33.png     PNG File WHRequestReceived-6.3.png     PNG File WebhooksConfig-6.2.33.png     PNG File image-2023-04-21-07-24-56-465.png    
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLHOOK-262 Implementation Sub-task Completed Dai Ha  
MGNLHOOK-263 Review Sub-task Completed  
MGNLHOOK-264 Pre-Integration QA Sub-task Completed  
MGNLHOOK-265 QA Sub-task Completed Javier Benito  
Team: DeveloperX
Date of First Response:
Epic Link: DevX Bucket
Sprint: DevX 36
Story Points: 2

 Description   

Asset publish webhook is firing twice on publish event, it should only fire once.

Input from partner:

Also regarding webhooks, I have a webhook listening for mgnl:asset publish and it appears to be triggering twice. I’m trying to diagnose to get you more info because I can’t see anything wrong.
^^^
 this is ultimately for a CloudFront cache purge integration. I think I’ve written a CloudFront cache purge about 10 times now so maybe it’s worth a more reusable integration. (edited)

Determined the issue is not really with webhooks but that for some reason the webhook launcher command is being triggered twice when i click publish once. so onto figuring out why that is happening

OK actually it is due to the webhook config.
The webhook module adds a webhook command to both the default-publish and versioned-publish command chains. However, the versioned-publish command chain references the default-publish, causing the webhook to trigger twice.

I think this is a bug but don’t know off the top of my head how to resolve it other than removing the webhook from default-publish (But then if something uses that you won’t get the webhook…)

 



 Comments   
Comment by Dai Ha [ 21/Apr/23 ]

Look like the issue has gone with latest 6.2 and 6.3, the webhook action is no longer there in chained versioned action and there is just 1 webhook event fired.

Comment by Javier Benito [ 24/Apr/23 ]

Tested on 6.2.33, and asset is only published once:

Definition:

Asset to publish:

Webhook request received in test endpoint:

 

Comment by Javier Benito [ 24/Apr/23 ]

Same result on 6.3:

Definition:

Asset to publish:

Webhook request received:

 

Generated at Mon Feb 12 10:02:34 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.