Possible bug in webhook product/update

Highlighted
Shopify Partner
77 1 11

Hi,

I'd like to report a problem I am facing.

When update product title and variants inventory quantities at the same time through the Shopify Admin product details page. The product/update webhook triggered does not include changes for all variants, even though the inventory quantity for those variants were changed.

I managed to replicate the problem every time with the followng steps:

  1. Go to product details page. Make sure the product has 3 variants (not sure if other number of variants replicate the same issue)
  2. Change the product title. DO NOT press save yet
  3. Change all the variants inventory quantity to something else (from my test each variant has different quantity)
  4. Press save
  5. Observe the webhook data. From my tests, only one variants contains the updated inventory quantity, other variants in the webhook data containd outdated quantity. However the quantity on Shopify admin has changed

Regards,
Sam

SimplyCost - Add costs and track profit (https://apps.shopify.com/simplycost)
2 Likes
Highlighted
Shopify Partner
77 1 11

Is there anyone from Shopify can comment on this? 

SimplyCost - Add costs and track profit (https://apps.shopify.com/simplycost)
0 Likes
Highlighted
Shopify Expert
4125 29 383

I am not Shopify but to add to your simple scenario, you might want to explore a bit more?

You have to be sure your target is not moving. Inventory is fluid. There is inventory sitting there, on the shelf, and then there is inventory sitting in carts, off the shelf. You don't see those unless you check carts too. So by saying you changed a 3 to a 4, but the webhook threw a 3, does not mean much if one is also in a cart. 

Maybe this is not your case.. but I am throwing that out there... playing with inventory and webhooks is NOT simple. It involves many moving parts, none of which are reliable unless you have aced all the inner workings of delta changes vs. static changes, with cart quantities too. And now we also have that new endpoint for Inventory too where future deliveries are involved. Phew... 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Shopify Partner
77 1 11

Yes I do understand that there are many moving parts when it comes to inventory quantiry, but I tested the scenario on my developement store, there is no other traffic other than from my test. I am sure there isn't other factor (in cart, etc) that could influence the inventories in my test case. 

It only happend if I change product title and multiple variants quantities at the same time. Changing only variants quantities there is no issue. 

The only way to make sure correct inventory quantities (assuming no other factors involved) is when a webhook (product/update) is triggered, app will do another API call to fetch the product in question. Which is not good. 

 

SimplyCost - Add costs and track profit (https://apps.shopify.com/simplycost)
1 Like
Highlighted
Shopify Partner
660 0 117

I was able to reproduce this issue as well.

Anyone from Shopify listening here? This is clearly a bug.

0 Likes
Highlighted
Shopify Partner
660 0 117

Weirdly enough it works fine if you don't update the product's name.

I also sometimes get 2 variants (out of 4) with the new update quantity, instead of just 1.

Some sort of race condition I would say...

0 Likes
Highlighted
New Member
9 0 0

Based on comments above, maybe your trying to get new inventory data too soon?

possibly adding a small wait to ensure everything is updated on shopify's end could resovle this issue

0 Likes
Highlighted
Shopify Partner
660 0 117

@shopneo, it's a webhook, not a poll here.

0 Likes
Highlighted
Shopify Partner
660 0 117

Could we have someone from Shopify to look at this?

This is a real bug for sure. It's causing some pain as our inventory quantities are not in sync with Shopify...

1 Like
Highlighted
New Member
5 0 0

Any update on this?

0 Likes