FROM CACHE - en_header

Return management just got easier! We’ve launched Customer Self-Serve Returns to all Shopify merchants. Click here to learn more!

BUG: Webhooks should return updated fields

Solved
Jason27
Shopify Partner
99 2 31

I would assume that most apps, if not all apps, only need to know what has CHANGED on an item (item/update webhook). Right now, all items that enter the queue must be totally reprocessed because we don't know what has changed, BUT If we knew which field had been modified, and it didn't fall under the app's scope, we could just throw it out of the queue rather than wasting 5+ separate api calls on it trying to figure out what had actually changed and whether it needs to be reprocessed.

 

Why can't there be an array of updated_fields included that we can use to quickly throw away items that don't concern us? It would save a TON of api calls!

Accepted Solution (1)

Accepted Solutions
ShopifyDevSup
Shopify Staff
Shopify Staff
520 78 146

This is an accepted solution.

Absolutely! I'll be sure to let our product team know how valuable you would find this feature.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 7 (7)
jordanholmes
Shopify Expert
79 15 19

Hello,

 

That is not really a bug but more a design choice by Shopify.

 

Surely you can just compare the data from the webhook to the data you have locally to see what has changed and then discard if it's not relevant. Not sure why you would need to make 5 (or any) api calls for this.

Jordan Holmes
Shopify Expert and Ruby on Rails Developer
https://experts.shopify.com/jordan-holmes
Jason27
Shopify Partner
99 2 31

Why even waste a single extra call that isn't necessary! It's a buggy design choice and it should have been addressed years ago. Some merchants send 200,000 webhooks per day - probably because of inventory. I don't want to spend any compute on these webhooks. Oh this is an inventory update, trash it!

Jason27
Shopify Partner
99 2 31

And to take it one step further - You can get so many webhooks from a single merchant, that if you app does require 5 or more api calls to complete the processing of a single item (Yes it is very possible if you are reading and saving metafields as well), it is mathematically impossible to process all the products in queue due to the Rate limits. It is literally impossible to process all the items sent by the update webhooks... how is this not a bug?

ShopifyDevSup
Shopify Staff
Shopify Staff
520 78 146

Hi @Jason27 👋

 

Although we don't support sending only the updated fields, you are welcome to select just the fields that are within your app's scope by specifying the `WebhookSubscriptionInput.includeFields` and `WebhookSubscriptionInput.metafieldNamespaces` parameters in the `webhookSubscriptionCreate` mutation. Webhook best practices are to implement periodic reconciliation jobs, and bulk operations intended to handle large volumes of data by design. 

 

Hope that helps!

 

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Jason27
Shopify Partner
99 2 31

Sorry but this canned response does not address the issue I described whatsoever. I hope you at least take the time to write down the idea and pass it to the right dev team for real analysis.

ShopifyDevSup
Shopify Staff
Shopify Staff
520 78 146

This is an accepted solution.

Absolutely! I'll be sure to let our product team know how valuable you would find this feature.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Jason27
Shopify Partner
99 2 31

Thank you! It would surely have a substantial impact on reducing the total load on your API servers.