Closed marlass closed 5 years ago
According to https://github.com/SAP/cloud-commerce-spartacus-storefront-docs/issues/203#issuecomment-510088647, i think we should avoid multiple carts for signed-in user. So for logged user we should always try to load exising cart (in case that on other device it has already been created). And we should also load it from backend before trying to create a new cart.
Tested it on dev17.
1, refresh the page. A get call for the previous cart 00010269 is sent, but 400 returned (Cart not found error displayed). - as expected.
Then another get call for the cart is sent, and a successful response returned with no cart.
In #3478 we fixed the issue with an infinite loop. However, we can improve the UX, by loading the current cart after catching "Cart not found" error. This will help in some cases with cart synchronization, but it will be still possible to have multiple carts on one user account when using multiple devices/browsers.