Hi everyone
I’m developing an app where the checkout button on the cart page triggers a fetch request to “/cart.js” to retrieve cart items. After adding monitoring functionality, I’ve noticed that sometimes the request response is empty. You can simulate this by executing a fetch request on the cart page via the console when there are no items in the cart.
However, it’s not possible to proceed to the checkout page with an empty cart—or at least it shouldn’t be. I’m trying to understand why this happens. I’ve even implemented a refetch functionality for cases when the returned cart object is empty.
I haven’t been able to reproduce this behavior. Is it possible that items appear in the cart for customers but are actually expired, sold out, or otherwise invalid? Could these items disappear after a page reload, despite being visible initially? That’s my current theory.
Thanks for any insights!