Shopify / shopify-app-bridge

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

app.getState('pos') - multiple devices returning identical pos.device.serialNumber #136

Open derrickrc opened 2 years ago

derrickrc commented 2 years ago

@samiulmonir06

More context here: https://shopifypartners.slack.com/archives/CKK8FHFDF/p1656603899976759

This was first reported nearly 2 months ago and is affecting multiple merchants using our app - thank you.

samiulmonir06 commented 2 years ago

@derrickrc : We have added a fix to resolve this issue. It should be available in version 7.7.0

derrickrc commented 2 years ago

@samiulmonir06 thanks so much!

derrickrc commented 2 years ago

@samiulmonir06 @heltisace I have additional information from merchants that this bug appears to be limited to newer iPads (e.g., 9th Generation). When you do your testing, please do so using 9th generation and other newer iPad models - thank you.

heltisace commented 2 years ago

@derrickrc got it, thanks! We tested the changes on the newer devices when pushing them, so hopefully everything will be okay. Let's wait until the next week to verify that the fix resolves the issue.

heltisace commented 2 years ago

Hey @derrickrc! We are rolling out POS 7.7.0 for iOS which should include the fix for this issue. If you cannot see the release, it should become available by the end of tomorrow. When you update to the new version let me know if the serialNumber problem still persists. Thanks!

derrickrc commented 2 years ago

@heltisace thank you, but unfortunately this isn't fixed. Now there is a new bug - instead of returning an identical device.serialNumber for these devices, the device.serialNumber is changing on every unique session / app load instead of persisting for that device.

Behavior on older iOS devices remains correct, the bug continues to affect newer iOS devices (tested this morning with a merchant using iPad Pro 10.5"). Their shop for reference is milk-pail-fresh-market.

heltisace commented 2 years ago

Hi @derrickrc. We are using react-native-device-info's uniqueId for the serial number value.

The change we pushed is calling a sync function on app launch. According to Notes here the only reason it would end up random is because IDFV doesn't exist. According to Apple Documentation IDFV can only be missing if the user just restarted the device and then it should be back right away.

I tried relaunching the app and restarting my iPad (iPad Pro 11") but the serial number stayed consistent on my side, and it is different from the serial number on my iPhone 14 Pro.

I will create a new internal ticket for that but so far we cannot replicate the issue.

derrickrc commented 2 years ago

@heltisace thanks Eugene, let me double check this again with the merchant and get back to you.

derrickrc commented 2 years ago

@heltisace upon checking with a couple merchants, this does appear to be resolved - thank you. I will close for now and in case it regresses, I will reopen.

derrickrc commented 1 year ago

@heltisace we just had a case where a merchant unboxed a new iPad and they used, I believe, the "Quick Start" feature to copy an existing iPad to a new iPad. In doing so, the new iPad retained the deviceSerialNumber of the other iPad, and despite uninstalling / reinstalling Shopify POS, rebooting the iPad, the two iPads had matching deviceSerialNumbers.

I realize this is an edge case, but is there any workaround to this in the future? Thanks.

heltisace commented 1 year ago

Hi @derrickrc! Sorry for the late response. I have an idea about why this is happening and will look into this.

derrickrc commented 1 year ago

@heltisace thanks! As an FYI, in the end we factory reset the iPad and set it up as new, and the deviceSerialNumbers were different.

moritzh commented 1 year ago

@derrickrc what was the App Version when the problem occurred?

derrickrc commented 1 year ago

@moritzh it was the latest version in the Apple App Store as of Dec 21, 2022. Thanks!

derrickrc commented 1 year ago

@moritzh @heltisace the Shopify POS 8.0.0 is causing the deviceSerialNumber to change again - I hope this is just a bug that can be resolved, as this is incredibly disruptive for our app given that we depend on this deviceSerialNumber remaining static. We already had to go through one migration for our merchants in the spring when Shopify transitioned to POS Next, we can't afford to do this again.

Up until Shopify POS 7.12.1:

image

Shopify POS 8.0.0 (same shop, device ID has changed):

image

MAlliShopify commented 1 year ago

Hi Team, I ran some test for the serial number issue, please see attached logs for details. Test 1: Fresh install of 8.2.0 Test 2: Delete the App then fresh install of 8.2.0 Test 3: Device Reset (Erased the device) Installed 8.2.0 Thank you

Logs

Fresh Install 8.2.0.zip Delete App and Install 8.2.0.zip Device Reset and Install 8.2.0.zip