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.
Was this always the case, or did it start recently?
I originally saw this when I was developing the app. I added a 50 ms delay between calls and that seemed to mitigate the problem for the most part. I would occasionally see an error but it was uncommon enough to be considered non-critical.
Recently, I’ve been seeing this problem occur much more often - 1 or 2 orders a day.
Which version of App-Bridge and POS are you using?
I originally saw the bug under 2.1.0, but upgraded to 3.1.1 and was still seeing the error
You mentioned that this issue usually happens when you add many items. In this context, how many is “many items”?
more than 25 line items added, and a discount then applied to each.
Just as an experiment, if you add a short delay between the addLineItemsToCart calls, does it fix the problem?
I’ve changed the delay from 50 ms to 200 ms. This seems to have fixed the problem.
@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.