saleor-storefront
saleor-storefront copied to clipboard
Losing cart when user is logging
Steps to reproduce the problem
- Add to cart any product
- Go to the checkout
- Sign in
- in some cases checkout cart is lost
System information Operating system: OSX Browser: Chrome Storefront Branch: master
This is appears to be caused by an ambiguity in the graphql schema description and result, for mutation checkoutcreate. when a user has a previously abandoned checkout, instead of creating a new checkout, an old checkout is returned instead. If the old checkout has no items in the cart you get the result above.
issue created in saleor-api: CheckoutCreate mutation returns open checkout when creating new one #6185
FYI: commenting out lines 301-> 306 in saleor/graphql/checkout/mutations.py quick fixes this problem (and possibly creates others)