a merchant informed us that they oversold a product due to a faulty stock update performed by the live sync of our ERP system. After investigating in our logs we discovered what I believe to be a transactional issue in Shopify.
In the inventory history of the product we see that it started out with an On Hand stock of 8, which was then set to 11 by our system. However our logs of the write which updated the stock to 11 report that we sent a quantity of 8 and a compareQuantity of 5. This indicates that the GraphQl API returned an On Hand value of 5. It must then have incorrectly applied the diff of 3 on top of the preexisting 8 and thus arrived at 11.
We exhaustively explored the logs on our side and could not determine any fault in our system. We would appreciate if someone with access to the logs on Shopify’s side would assist in fully explaining the behaviour in the merchants systems.
Not sure if we store request ids, but I am happy to share any relevant information that we can provide. However I would prefer to not share any merchant specific information publicly
@liam-shopify could you help us dig into this one? We’d really appreciate a pointer on how to identify and eliminate the root cause.
On our side, we can pinpoint exactly which inventory movement in the merchant’s inventory history is the faulty one and are happy to share timestamps, for example.
As a stock management system, making sure the correct stock is synced to Shopify is essential for us — incorrect stock leads directly to oversells or false out-of-stock situations for the merchant’s customers. What makes this bug particularly painful is that it fails silently: neither we nor the merchant gets any signal that the stock is off, so it can sit broken for days before anyone notices.