Shopify / ui-extensions

MIT License
265 stars 37 forks source link

[Checkout UI Extension] Could not apply line item changes. Error: Negotiation was stale. #2140

Open st-hungdinh opened 3 months ago

st-hungdinh commented 3 months ago

Please list the package(s) involved in the issue, and include the version you are using

"react": "^18.0.0",
"@shopify/ui-extensions": "2024.4.x",
"@shopify/ui-extensions-react": "2024.4.x"

Describe the bug

I use applyCartLinesChange hook to apply line item changes (in my case: only changing the line item attributes) often fails with the message "Could not apply line item changes". Unfortunately, this message is all that is returned, and no other feedback is given as to why it fails.

This issue also seems inconsistent, sometimes the changes do apply without an error and sometimes the error does appear.

I am applying the line item change in purchase.checkout.block.render, could this be because of a large cart, triggering a lot of line item changes causing the endpoint to ratelimit?

Steps to reproduce the behavior:

Expected behavior

Screenshots

image

Additional context