Hi,
I'm relatively new to development, I'm building a rails app as my first Shopify app.
I've currently got a webhook on the orders_fulfilled event. The webhook and job behave as expected, but after the first successful event it keeps trying (and I get the emails saying it is failing).
my shopify_app.rb:
config.webhooks = [
{topic: 'carts/update', address: 'https://super-simple.ngrok.io/webhooks/carts_update', format: 'json'},
{ topic: 'orders/fulfilled', address: 'https://super-simple.ngrok.io/webhooks/orders_fulfilled', format: 'json'}
]
Then I've got a job (I've left out the code for brevity):
class OrdersFulfilledJob < ActiveJob::Base
To test the job, I've made a button that creates and fulfills the order in a single click (it POSTS to orders#create in orders_contoller.rb, where I've written the logic)
You can see from this Ngrok screenshot that after I press that button it creates the order, successfully triggers the webhook with a 200, then continues to try again.
In my server logs each subsequent POST request ends with "Filter chain halted as :verify_request rendered or redirected"
The docs say "Your webhook acknowledges that it received data by sending a 200 OK response" so I thought the 200 I'm seeing would do it, but obviously I'm missing something.
Any help on how to stop the re-tries would be greatly appreciated!
Hi mate,
Yep weird one for sure
Shopify has a 5 second time-out.
Perhaps your app isn't responding within the Window?
Maybe try calling your app with postman etc to see the response time.
This way you can guarantee your receiving a 200 response on the other end, and check the response time.
If your app is doing some processing before sending the 200 it will cause it to miss the 5 second window.
Or maybe there is a lot of latency between shopify servers and your endpoint.
docs Under Frequency:
User | Count |
---|---|
16 | |
12 | |
7 | |
5 | |
4 |