saleor-storefront icon indicating copy to clipboard operation
saleor-storefront copied to clipboard

Losing cart when user is logging

Open korycins opened this issue 4 years ago • 1 comments

Steps to reproduce the problem

  1. Add to cart any product
  2. Go to the checkout
  3. Sign in
  4. in some cases checkout cart is lost

Aug-11-2020 12-17-54

System information Operating system: OSX Browser: Chrome Storefront Branch: master

korycins avatar Aug 11 '20 10:08 korycins

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)

tommytobi avatar Oct 01 '20 09:10 tommytobi