Randomly Getting Duplicate Webhooks

Jonathan_Chan
Shopify Partner
4 0 0

On random I would get duplicate webhooks fired to my server (look at the red highlighted log). Should I expect this behavior? The fulfillment id is 

1726263459930. The request is coming in so fast that it is producing a race condition where I can't even check the DB if the fulfillment has already been created because it is sent at the EXACT same moment (24/Oct/2019:19:37:12). The only other option is to push them to a queue and absolutely ensure I process them one at a time. It'd be great if this can be fixed on shopify's side so I don't have to spin up redis/sidekiq and friends.

 

nginx.1    | api.tailoredindustry.com 35.196.32.214 - - [24/Oct/2019:17:58:55 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 34.74.57.205 - - [24/Oct/2019:18:09:06 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.196.32.214 - - [24/Oct/2019:18:09:23 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 34.74.94.27 - - [24/Oct/2019:18:11:11 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.231.133.198 - - [24/Oct/2019:18:13:24 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 34.74.109.43 - - [24/Oct/2019:19:17:21 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.243.153.110 - - [24/Oct/2019:19:25:24 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.231.166.181 - - [24/Oct/2019:19:37:12 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.231.166.181 - - [24/Oct/2019:19:37:12 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.231.37.219 - - [24/Oct/2019:19:43:44 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.229.47.220 - - [24/Oct/2019:19:56:37 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.227.36.248 - - [24/Oct/2019:19:59:14 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 34.74.95.232 - - [24/Oct/2019:20:01:43 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.227.114.113 - - [24/Oct/2019:20:05:08 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 34.74.95.232 - - [24/Oct/2019:20:08:01 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 104.196.45.139 - - [24/Oct/2019:20:08:18 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.196.128.178 - - [24/Oct/2019:20:09:56 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 104.196.45.139 - - [24/Oct/2019:20:10:14 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.196.125.7 - - [24/Oct/2019:20:11:54 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 35.196.125.136 - - [24/Oct/2019:20:12:08 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

nginx.1    | api.tailoredindustry.com 104.196.58.164 - - [24/Oct/2019:20:21:24 +0000] "POST /shopify/webhooks/fulfillment_create HTTP/1.1" 204 0 "-" "Shopify-Captain-Hook"

 

 

 

Replies 2 (2)

Jonathan-HA
Shopify Partner
314 24 98

Hey Jonathan,

 

There was an update some time back to address duplicate webhooks: https://community.shopify.com/c/API-Announcements/Upcoming-improvements-to-Webhooks/td-p/398576

 

Though I don't think it's guaranteed that they will never send duplicates so it's probably still a good idea to account for them.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill

dsoprea
Shopify Partner
11 0 2

Going to awaken this thread because I suddenly started getting these a month or two ago. They happen once every five or ten orders. It sounds like people are not generally surprised that these happen and the prevailing sentiment is just that people detect and ignore them. Still, if this is a bug, it'd be nice to be told whether it's a known one.

 

We're on the 2022-04 API.