datalogic / cordova-plugin-datalogic

Cordova Plugin for Datalogic Android SDK
0 stars 7 forks source link

Ionic / Angular / Change detection not working or delayed for scans to observable #15

Closed AndeeZee closed 2 years ago

AndeeZee commented 2 years ago

Hello!

We are currently investigating the use of the Memor K for our services, however, we found an issue which is a showstopper, if not resolved.

I created a sample app: Use case is: Scan codes and put them in a list and display the list on screen. Of course the list should have live update. So once a scan is performed, it should show up in the list immediately. Please find the sources here: 20220714_datalogic.zip Please find the apk here: 20220714_app-debug.zip

The problem is, that scans are showing up in the list with a huge delay or not showing up at all. To demonstrate the differnce, there is a blue button on the screen, where a scan can be simulated.

1 2 3

The ReadListener from the BarcodeManager is triggering the same function as the fake one: myService.populateListEntry(scanResult)

This issue is reproducable.

Would you be so kind to have a look into this?

Thank you very much, Andy

AndeeZee commented 2 years ago

After more analysis: This issue is related to zone. Function inside the callback needs to run inside zone. After that, it works.