Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
85 stars 9 forks source link

Cart.Action.ADD_LINE_ITEM resulting in "product couldn't be found and was removed" #176

Closed derrickrc closed 10 months ago

derrickrc commented 1 year ago

I believe this may have a similar root cause related to: https://github.com/Shopify/shopify-app-bridge/issues/114

Describe the bug

Our app programmatically creates a new product variant via the Shopify API, and then we pass the variantId back to our app and use Cart.Action.ADD_LINE_ITEM to add this to the Shopify POS cart. We have been doing this for years and it works.

We have a merchant based in Australia who is intermittently receiving this error which is causing a lot of disruption to their workflow (video: https://photos.app.goo.gl/6tWcwY5QgxBBu6BJ7)

20230201_101045

My hypothesis is it may have to do with how far they are from Shopify's servers, given that they're in Australia. The 200 response from the Shopify API after creating this new product had nothing out of the ordinary compared to other responses.

To Reproduce

Steps to reproduce the behaviour: I am unable to reproduce

Expected behaviour

The product should be added to the Shopify POS cart

Contextual information

Packages and versions

List the relevant packages you’re using, and their versions. For example:

Platform

derrickrc commented 1 year ago

Hi team, we have another merchant who reported this and it's severely impacting their usage of our app (please see image below). Could you please help us to further investigate?

@vctrchu @henrytao-me

IMG_1534

vctrchu commented 1 year ago

@derrickrc Can you please provide:

Thanks

derrickrc commented 1 year ago

@vctrchu

  1. Programmatically create new product on server using Shopify API
  2. Return new variantId to our Shopify POS embedded app
  3. Use Cart.Action.ADD_LINE_ITEM to add it to the POS Cart

Our app: https://apps.shopify.com/sell-products-by-weight

We cannot reproduce this, but we believe it has to do with communication between Shopify POS and its servers. Thank you.

derrickrc commented 10 months ago

@pkhanal @vctrchu any update? This is still happening and is still afflicting certain merchants in rare cases. I believe it has to do with communication between Shopify POS and its servers, e.g. when using a slower internet connection or hotspot.

pkhanal commented 10 months ago

At this point, we recommend partners to build in UI Extensions.

derrickrc commented 10 months ago

@pkhanal you can close this for now, but we suspect this issue is agnostic as to whether the add to cart action is from POS UI Extensions or App Bridge. We are launching our POS UI Extension later this year for this app and will reopen if it continues to occur.