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

TAGS.cart Not Revalidating Correctly After Page Refresh #1402

Open
oscarmylla opened this issue Nov 6, 2024 · 3 comments
Open

TAGS.cart Not Revalidating Correctly After Page Refresh #1402

oscarmylla opened this issue Nov 6, 2024 · 3 comments

Comments

@oscarmylla
Copy link

After performing a page refresh, TAGS.cart is not revalidated correctly. This leads to potential inconsistencies between the client-side and server-side state of the cart data.

Screen.Recording.2024-11-06.at.20.18.44.mp4
@oscarmylla
Copy link
Author

oscarmylla commented Nov 6, 2024

It appears that the issue arises from using getCart within the updateItemQuantity action, which then revalidates the tag that getCart utilizes within the same action.

When applying "no-store" to all getCart invocations within the cart actions, everything functions as expected.

Do you have any suggestions for a more optimal solution?

@dsbrianwebster
Copy link

@oscarmylla. Ha! Literally just finished a recording of this exact bug, but thankfully spotted your issue before opening a dupe. I can confirm "no-store" on getCart serves as a workaround. Subscribing to hopefully see the more optimal solution that gets implemented.

@nikosantis
Copy link

nikosantis commented Dec 11, 2024

I was thinking.
When we try revalidate the tag TAGS.cart thats mean, all the cart cached will revalidate no? no matter the user.
Why not
${TAGS.cart}-${cartId}

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

3 participants