Shopify / ui-extensions

MIT License
267 stars 35 forks source link

The applyAttributeChange hook mistakenly identifies an accelerated wallet in error #2340

Open alexkates opened 1 month ago

alexkates commented 1 month ago

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

"@shopify/app": "latest", "@shopify/cli": "latest", "@shopify/ui-extensions": "2024.4.x", "@shopify/ui-extensions-react": "2024.4.x",

Describe the bug

When clicking a button in our Checkout Extension that calls applyAttributeChange, we get an error saying "Could not apply mutation applyAttributeChange: the buyer is using an accelerated wallet".

As you'll see in the video, I don't believe we are in an express checkout flow or using an accelerated wallet.

Furthermore, if I attempt to recreate this in-cognito, the applyAttributeChange call works as expected.

Steps to reproduce the behavior:

To re-create this in one of our partner Shopify sites ...

  1. Go to https://www.hatchcollection.com/products/the-hatch-boyfriend-maternity-jean?color=destroyed-light-wash
  2. Click Add to Bag
  3. Click Checkout from the cart-flyout
  4. Open developer tools and look at errors
  5. Click Opt In for the Croissant Checkout Extension, next to "Get Guaranteed Buyback"

Expected behavior

Clicking the Opt In button should add the product to the cart line items and set the croissant_opt_in flag to true on the cart attributes.

Screenshots

https://github.com/user-attachments/assets/17d70652-a291-4847-bd4c-9b88e8ece471

Additional context

It doesn't break for everyone in our company, but enough people are able to recreate it. Some of us seem to be incorrectly in an express checkout? We're not entirely sure.

Also, it looks like this thread may have been circling around a similar thing https://github.com/Shopify/ui-extensions/issues/1511#issuecomment-2318279333

alexkates commented 6 days ago

Has anyone been able to look at this or have any questions we can help answer?