It seems like there is a bug in WebNFC's NFCReader. When the web page is minimized, the call still appears to be pending, although it will become glitched. When the page is minimized on the phone and then maximized, the scans will not arrive into WebNFC API but would be directly dispatched to the system.
In order to work that around, we will detect that the web page was minimized and the call to execHaloCmdWeb() will fail under such a circumstance. The web page could reschdule the call once it's maximized again.
Checklist
Changes to the drivers
[ ] (PR Author) The affected drivers were manually tested
Changes to CLI
[ ] (PR Author) The change was manually tested with the CLI
[ ] (PR Author) The affected CLI features are working with the standalone binary (at least one platform)
[ ] (Checked by maintainer) The CLI test procedure was run by the project's maintainer
Changes to web library
[ ] (PR Author) The change was manually tested with the web library included within a classic HTML application (flat libhalo.js)
[X] (PR Author) The change was manually tested with the web library included within an app based on frontend framework (React.js or similar based on webpack)
[ ] (Checked by maintainer) The web test suite was run by the project's maintainer
Changes to nfc-manager driver
[ ] (PR Author) The change was manually tested in React Native app
[ ] (Checked by maintainer) The test suite was run through the test React Native project
Description
It seems like there is a bug in WebNFC's NFCReader. When the web page is minimized, the call still appears to be pending, although it will become glitched. When the page is minimized on the phone and then maximized, the scans will not arrive into WebNFC API but would be directly dispatched to the system.
In order to work that around, we will detect that the web page was minimized and the call to
execHaloCmdWeb()
will fail under such a circumstance. The web page could reschdule the call once it's maximized again.Checklist
Changes to the drivers
Changes to CLI
Changes to web library
libhalo.js
)Changes to nfc-manager driver