Shopify / ui-extensions

MIT License
249 stars 35 forks source link

POS GO freezing when barcode scanning #2029

Closed jordanfinners closed 3 weeks ago

jordanfinners commented 1 month ago

Please list the package(s) involved in the issue, and include the version you are using

retail-ui-extensions v1.7.0

Describe the bug

When using the Scanner API on a POS UI Extension app. When the scanner is used to scan a barcode, the Shopify POS GO device freezes.
The merchant reports that when this happens the scanner turns off and the device had a popup that said "restart device to use scanner".

Steps to reproduce the behavior:

  1. Create a JavaScript POS UI Extension and deploy to POS GO device
  2. Subscribe to the scanner api.scanner.scannerDataSubscribable.subscribe
  3. Load the Camera Scanner Component if there is a camera source
  4. Attempt to scan a barcode
  5. POS Go device freezes

Expected behavior

POS Go device should support scanning barcodes without freezing or device errors.

Additional context

I added monitoring to capture what page the user is on and any possible exceptions etc and it hasn't reported any so I believe this is a lower level issue with either the scanner library or POS GO device.

jordanfinners commented 3 weeks ago

This was caused by rendering the camera scanner, without checking if there was a camera source. I'll close the bug as working as intended.

Would it be possible for the CameraScanner to not crash the device if that's the case?