Open KateChuen opened 2 years ago
Here are some finding (with help from @bgambocjaviniar):
It seems to be a backend issue when a replenishment order is placed. It seems that the endpoint is duplicating a cart containing the item(s) purchased in the replenishment order. This cart is added to the list of carts the user has and becomes active after saving the current cart because by saving the current cart, that duplicate cart falls next in place and is loaded as active.
Here are some images that help illustrate what's happening under the hood:
State of the carts list of user at the beginning
Adding an item to cart and place order as replenishment. Here is the product:
After placing order as replenishment we can observe a list of actions done to the local Store (Ngrx). In this list there is no action that creates a new cart with the same item:
After adding another product to the shopping cart we can observe the state of the carts in the backend. In this image we can see how there is two carts, indexed 0 and 1. The cart: 0 is the current empty shopping cart (as usual). Cart: 1 contains the same product from earlier placed as a replenishment order. Note the code of this cart is 00002294
Here is the shopping cart after saving the current cart. Note here that the cart code matches that of cart: 1 from (4) and contains the product.
Environment Details Browser: Chrome Device: mac Frontend: 4.2 RC0 Backend: release/2105/next branch on devci4 Happens on: https://spartacus-devci7674.eastus.cloudapp.azure.com:5201/powertools-spa/en/USD
Steps to Reproduce Go to powertools storefront Login as a b2b customer, for eg, marie.dubois@rustic-hw.com/pw4all Add any product to cart and place order as a replenishment order (for eg, every 1 day, starting today), for eg: 3879437 Now your cart is empty. Add another product or a few products to cart. Save the cart.
Actual Result You'll see the item from the replenishment order we placed previously in the cart now.
Expected Result I was expecting an empty cart