@ShopifyDevs We've been getting more and more complaints from merchants about an increased sensitivity in the CloudFlare bot protection when interacting with the AJAX Cart API (https://t.co/hs7LhE3MXK)
Now even the local `shopify app dev` environment is affected by this (see video)
Two months ago, we launched the Kaching Cart Drawer app on @Shopify .
Since then:
- Over 360 code deployments;
- More than 50 feature releases;
- 2,000+ merchants using the app;
- 24 reviews;
- Ranking №7 for the "cart drawer" keyword.
It's just the beginning 🚀
Has anyone faced issues with add to cart analytics not being tracked when:
1. Request to /cart/add.js to add item to cart
2. Right after the previous request, you make a request to /cart/update.js?
@kentcdodds Would you say that riding a onewheel off-season helps in getting better at snowboarding or do they feel very different and there's no real connection between the two?
Do the Cart API endpoints and Storefront API mutations use optimistic updates internally? I'm trying to figure out how to handle a race condition I'm dealing with when using `/cart/update.js`
1. Cart starts with 2 items
2. User removes first item
3. Await first removal using update.js endpoint
4. Run additional update.js call based on new cart state
5. User quickly removes second item
6. Cancel the previous pending update.js call (using AbortSignal) made in step 4
7. Await second removal using update.js endpoint
8. Run another update.js call based on new cart state
In step 7 I get the correct empty array of items, but in step 8 I get the items array containing the item that was supposed to be removed in step 7.
Understandable, I find SCSS to be helpful with this. Nesting classes makes the output css contain multiple classes in the selectors, so it adds to the specificity score.
The best thing is obviously to just use a more unique class prefix or, for web components, use the shadow dom.