-
Notifications
You must be signed in to change notification settings - Fork 140
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
[BUG] Custom parameters not taking into account for cache invalidation #1771
Comments
@LucasReyre I was able to reproduce what you saw. Thanks for reporting this bug. |
This issue has been linked to a new work item: W-15678650 |
Hello @vmarta Is there any news concerning this bug ? Thanks |
Hi @LucasReyre unfortunately we have not picked up this work yet, but I'll reach out to the team to see if there's a feasible workaround. |
@LucasReyre This isn't supported yet and i wonder if there is a workaround... I'm not sure but it may be a way to temporarily unblock the issue. update your useBasket to include the same custom query parameter, that will make the basket query and mutation to have the same cache key.
|
Thanks @kevinxh for the workaround, it's not ideal but it works. |
Summary
When updating basket (
useShopperBasketsMutation('updateBasket')
of commerce-sdk) with a custom parameter in the query it seems that the cache is not in invalidated data.This causes the basket object not to be updated with the data coming from the PATCH basket.
Steps To Reproduce
1 - Create hook to update an attribute in the basket
2 - Update the basket
Expected result
I'm supposed to have my basket object updated with the actual values
Actual result
My basket has been well updated but not the cache basket object.
I've test without the custom parameter and everything is working well.
System Information (as applicable)
Node version: 18.17
@salesforce/retail-react-app: 2.4.0
The text was updated successfully, but these errors were encountered: