Questions and discussions about using the Shopify CLI and Shopify-built libraries.
I'm using app-bridge to to add multiple items and discounts to a cart in a short period of time.
e.g.
addLineItemToCart(data: AddLineItemData): void => { this.cart.dispatch(Cart.Action.ADD_LINE_ITEM, { data }); }
items.map((i) => addLineItemsToCart(i));
Later, I fetch the cart to confirm items have been added.
I find that sometimes, especially when adding many items, some items don't get added or discounts don't get applied.
This leads me suspect I'm running into rate-limiting. Is there any way to confirm this suspicion in app-bridge?
@mngibso , thanks for reporting this.
There is no explicit rate-limit in App-Bridge, so what you're describing seems like a bug.
I will ask the team to look into it. In the meantime, if you can answer these questions, it might help us to try and reproduce the issue:
To learn more visit the Shopify Help Center or the Community Blog.
Thanks for the prompt response!
To give you more information, the app will add line items, then immediately update those line items with a discount via `SET_LINE_ITEM_DISCOUNT`. It's the discount call I see isn't getting applied to the cart more than the `ADD_LINE_ITEM`.
@mngibso , I confirmed with our engineering team that there is a race condition in the POS app.
The team is working on a fix, and I hope they'll be able to get it ready in time for the next POS release. I'll follow up as soon as I know that the fix has been released.
To learn more visit the Shopify Help Center or the Community Blog.