Questions and discussions about using the Shopify CLI and Shopify-built libraries.
I am encountering a bug on iOS with App Bridge where if I call:
cart.dispatch(Cart.Action.ADD_LINE_ITEM, { data: payload });
and it's a custom sale item with the exact same line item details as an item already in the cart, Shopify POS immediately crashes and not only that, I'm unable to ever reopen Shopify POS again - I'm forced to uninstall and reinstall it.
The same code works fine on Android and I swear it was working a few days ago on iOS.
Here is the stacktrace from OSX console:
default 16:00:26.308014 -0700 Shopify POS *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CartController : Duplicate Section.Row keys' *** First throw call stack: (0x19e2bca48 0x19dfe3fa4 0x19e1c10ec 0x107055c38 0x10705bee4 0x10707c260 0x10707c38c 0x10707c300 0x107075360 0x107079988 0x10704f8c0 0x19e6813a0 0x19e58b0c8 0x19e683628 0x19e58ad60 0x19e684020 0x19e683aec 0x19df3b7dc 0x19df89184 0x19df31a3c 0x19df31190 0x19df3dfa4 0x19df3e770 0x19dfd8b48 0x19dfdb760) default 16:00:26.308424 -0700 backboardd Connection removed: IOHIDEventSystemConnection uuid:429D797F-61CE-41C2-AD5A-29C6AE8C9AC3 pid:920 process:Shopify POS type:Passive entitlements:0x0 caller:BackBoardServices: <redacted> + 380 attributes:{ HighFrequency = 1; bundleID = "com.jadedpixel.pos"; pid = 920; } inactive:0 events:0 mask:0x0
I know it's been asked before, but is there a github repo where we can actually raise issues?
Solved! Go to the solution
This is an accepted solution.
Hey @policenauts1,
I did some digging on this issue and I could not reproduce the crash using a test shop of ours.
Would I be able to get the exact payload you're using for creating these line items and the shop you're testing this app on? This might give me some more insights into what's going on.
----
As far as your other issues listed there: I'll look into them individually and reply when I have done some investigation work.
We are working on a place for posting App Bridge issues though.
To learn more visit the Shopify Help Center or the Community Blog.
Hello @policenauts1 ,
Thanks for reporting this issue to us, we would love to fix this but we need some more information.
What version of Shopify POS are you running when this is happening? What version of iOS and device type? And lastly what version of App Bridge are you using?
To learn more visit the Shopify Help Center or the Community Blog.
Thanks @andrew-apperley for getting back to me so quickly. It's iPad, new POS, 6.8.0, build 639, running ios 13.5.1, iPad7,5. The same behavior is fine on Android. I don't know which version of App Bridge, I'm importing the CDN using <script src="https://unpkg.com/@shopify/app-bridge"></script>.
While I have you on the line, there are a few other bugs (though obviously not as fatal as this one):
Is there any kind of public bug tracker so that we can get updates to when things get fixed? I've currently built hacky workarounds due to the above and in the past week I've already found certain things suddenly stop working because it seems that someone has begun working on it and the behavior changes. For example, a week ago I swear certain subscribes simply weren't ever being called with iOS, now it looks like some are running multiple times. Thank you.
This is an accepted solution.
Hey @policenauts1,
I did some digging on this issue and I could not reproduce the crash using a test shop of ours.
Would I be able to get the exact payload you're using for creating these line items and the shop you're testing this app on? This might give me some more insights into what's going on.
----
As far as your other issues listed there: I'll look into them individually and reply when I have done some investigation work.
We are working on a place for posting App Bridge issues though.
To learn more visit the Shopify Help Center or the Community Blog.
Hi @andrew-apperley , it looks like as of today the bug isn't happening anymore. I'll consider this resolved, thank you for the follow-up.
Hi @andrew-apperley ,
I also encountered a problem on App Bridge iOS. It is similar to this one, about dispatch actions. Although in my case, the app is not crashed, but nothing is dispatched. I've opened another forum post here: https://community.shopify.com/c/Shopify-APIs-SDKs/AppBridge-sometimes-does-not-dispatch-actions-in-i....
Thanks,
Michael
@andrew-apperley this problem is actually still occurring (duplicate custom sale item added via App Bridge to cart causing repeated crash). I realized it happens for certain price payloads - can you please see if you can reproduce? Here are my App Bridge requests:
Optional Params: [{"type":"APP::CART::ADD_LINE_ITEM","group":"Cart","payload":{"data":{"price":4.69,"quantity":1,"title":"Custom sale (70 g @ $0.067 per g)"},"id":"52d85c7d-1a56-0987-3870-231b0e4156e6"},"version":"1.25.0","clientInterface":{"name":"@shopify/app-bridge","version":"1.25.0"},"source":{"apiKey":"635c3add70ebdf3b81518d25d6acc86b","shopOrigin":"fjtesting2.myshopify.com","forceRedirect":true}}]
Optional Params: [{"type":"APP::CART::ADD_LINE_ITEM","group":"Cart","payload":{"data":{"price":4.69,"quantity":1,"title":"Custom sale (70 g @ $0.067 per g)"},"id":"008e5a00-e88c-4b72-98a1-52c1451a40ab"},"version":"1.25.0","clientInterface":{"name":"@shopify/app-bridge","version":"1.25.0"},"source":{"apiKey":"635c3add70ebdf3b81518d25d6acc86b","shopOrigin":"fjtesting2.myshopify.com","forceRedirect":true}}]
Here is a sample payload - please use the App Bridge add to cart dispatch action on iPad new Shopify POS and then leave it in the cart and then add the same payload.
const lineItemPayload = {
price: 4.69, // 0.56 will also cause the crash, meanwhile 0.55 is fine
quantity: 1,
title: 'title',
};