I have a client (whose site I did not develop, but am now the developer for) who uses the AJAX API to add products to the cart, using the code nearly verbatim from https://github.com/carolineschnapp/ajaxify-cart
I've been able to repeatedly reproduce a bug that their customer service team has had reported from customers-- namely, if you add the same thing (product with exact variants) to your cart as another user with an active session who is also adding that product to their cart, then both users end up with the same cart token.
The reproduction scenario is as follows:
USER1 adds product1 with variant1a and variant 2a to their cart. They are assigned a unique cart token (verified at shopname.com/cart.json) and continue to browse the store.
USER2 adds product1 with variant1a and variant2a to their cart. They get the same token as USER1. When USER1 returns to the cart they notice the product now has a qty 2 instead of 1, even though they just put 1 in their cart.
Since the store does not pass any attempt at setting a token, only adding the product to the cart (and setting a cookie to remember the variant selection if the user returns), it would appear that there's a bug in the API or backend which sees two different users with the same cart as the same user and reassigns those two users the same token.
My question is, has anyone seen this before, and will anyone at Shopify take a look? Normal support channels defer all API related issue to the forum.
I reproduced it with one browser in Chrome incognito and the other in Safari, after noticing oddities while browser testing other features I was developing. It's been reproduced by their staff (different people in different states), and also reported by customers over time.
Here's a screenshot of my Chrome and Safari browsers side by side:
It looks like we're still getting weird behavior with quantities greater than one. In one instance we found that if one user added 3 to the cart and another user added 5, the second user ended up with qty 15 in the cart... any ideas?