Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session bug when starting on a PDP and adding to cart #80

Open
kamui opened this issue Jul 24, 2024 · 1 comment
Open

Session bug when starting on a PDP and adding to cart #80

kamui opened this issue Jul 24, 2024 · 1 comment

Comments

@kamui
Copy link

kamui commented Jul 24, 2024

Hey, we're working on implementing Vendure and we started using this remix storefront to get started. In our case, we started with porting the fly out cart to its own page and checkout since we have our own product detail pages (PDP) already.

So, while porting cart and checkout we created a hard coded product page so we could add things to cart to test the cart and we found what seems like a bug. In this base stock storefront app, if you go from home page or PLP > PDP > Add to cart > Cart everything works. If you clear cookies and db sessions in Vendure or otherwise start on a PDP (without loading homepage or PLP pages) > Add to cart > Cart, there seems to be a problem with the cart reading the session properly. You can add to cart, and it makes the correct API request, but if you refresh the page, the cart is empty.

I think it's related to not loading the activeCustomer correctly on the PDP. We've had multiple devs able to reproduce this with a stock storefront with the seeded data in a Vendure instance.

@michaelbromley
Copy link
Member

Hi Jack,

Thanks for the report. I just tested in on the live demo instance https://remix-storefront.vendure.io/products/cordless-mouse and I can confirm the reproduction.

On non-PDP pages, after deleting the cookie and refreshing, the vendure_remix_session cookie will be populated with a value like

eyJhdXRoVG9rZW4iOiI1OTVhMzIxNjQ4NzAwZWYwM2UwMDBiNDhjNzcxMTZmZmVlNGI4M2Y4NTVlYWE1MWU5Yjk4YTNkOTdlOTY5MjNhIn0%3D.Smn%2Fru8rBk%2Fz%2FrI9R%2FS9VDh4888XYKlHEvtdvYnJXm8

However, when I refresh on the PDP the vendure_remix_session cookie has a value like

e30%3D.EAVflXkRkI1eU4uLtIrdqTHh%2B9%2F8OSR9umy5HG%2FgiwY

clearly the wrong data is being set in the cookie in this case. I don't have time to look deeper into it right now, but that at least narrows down the area of investigation quite a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants