bigcommerce / b2b-buyer-portal

B2B Buyer Portal - BigCommerce B2B Edition
MIT License
25 stars 19 forks source link

Issue report: Persist cart not working while using buyer portal #73

Closed cjsanchezBW closed 2 months ago

cjsanchezBW commented 2 months ago

Please fill out this template to help us diagnose and address your issue effectively.

Type: (Select one)

Summary:

Expected Behavior:

Actual Behavior:

Steps to Reproduce (Bug Reports Only):

  1. List the specific steps necessary to reproduce the bug. I log in as a user who can add items to cart. I add an item to the cart. I log out. I log back in. My cart is empty

Additional Information:

Version:

cjsanchezBW commented 2 months ago

I looked through the code and found that in the apps\storefront\src\pages\Login\index.tsx file, in line 131, there's a block of code that runs a deleteCart function when the user logs out.

I am working on a customized buyer portal. For my project we do want the persisted cart to work. Would it cause issues to remove that code that deletes the cart at logout?

bc-victor commented 2 months ago

@cjsanchezBW The carts are deleted by default because I'm afraid you'll still lose the cart after 1 re-login. This is a known issue within the BCs storefront APIs that is currently in the feature request status. Closing since this is just not supported yet

cjsanchezBW commented 1 month ago

@bc-victor What do you mean by: "The carts are deleted by default because I'm afraid you'll still lose the cart after 1 re-login."

I tested removing the code that deletes the cart and I was able to logout and back in and keep my cart's contents without issues.

apps\storefront\src\pages\Login\index.tsx file, in line 131

bc-victor commented 1 month ago

@cjsanchezBW according to our research, these carts will be lost between authentication processes. If your findings are persistent throughout your development please let us know so I can file this behaviour

SunilP-WassDigital commented 1 month ago

@cjsanchezBW if i remove code await deleteCart(deleteQuery); on same browser it is working fine But let's example , i m doing logout and then open incognito window and login with same user, it should be preserve same cart but does not doing that.