App Bridge iOS bug? causing Shopify POS app crash and forcing uninstall + reinstall

Solved
Highlighted
Pathfinder
131 11 20

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? 

 

0 Likes
Shopify Staff
Shopify Staff
17 5 3

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?

Andrew Apperley
(App Bridge) Mobile Developer
0 Likes
Highlighted
Pathfinder
131 11 20

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):

  1. On iOS, I'm finding subscribing to certain events is causing it to fire multiple times and I have to put in a boolean flag to stop it if I only want it to run once. 
  2. getState() with the pos object doesn't fully work on Android, it returns null for pos.device.name. I need this because it seems certain things work inconsistently between iOS and Android, and also for distinguishing between POS and Admin. 
  3. App Bridge Line Item Properties get added to the cart level in the note_attributes field, meanwhile Cart Properties don't show up anywhere. This has been asked about multiple times recently on this forum
  4. Can you please align center the app bridge Toasts?

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.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
17 5 3

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.

Andrew Apperley
(App Bridge) Mobile Developer
0 Likes
Highlighted
Pathfinder
131 11 20

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. 

0 Likes
Highlighted
New Member
5 0 0

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

0 Likes