BlinkID / blinkid-in-browser

BlinkID In-browser SDK for WebAssembly-enabled browsers.
https://microblink.com/blinkid
59 stars 30 forks source link

"Missing video feed" error thrown in recognitionLoop are not always caught #45

Open sveres opened 3 years ago

sveres commented 3 years ago

Hi,

We've tried enabling barcode reading via the camera feed but run into some issues on production.

We saw a lot of "Uncaught (in promise): Error: Missing video feed!\nError: Missing video feed!" unhandled errors.

It seems to me that the "Missing video feed" error thrown in VideoRecignozer's recognitionLoop method is not handled properly sometimes. https://github.com/BlinkID/blinkid-in-browser/blob/6b2af6dcaba91006de70b7ec7a8b2905e987fa9e/src/MicroblinkSDK/VideoRecognizer.ts#L551

As far as I can see there are 3 calls to this method and only one of them handles the error, in the two other cases, the recognitionLoop is called within a setTimeout. In this case the error cannot be caught and processed properly. e.g. https://github.com/BlinkID/blinkid-in-browser/blob/6b2af6dcaba91006de70b7ec7a8b2905e987fa9e/src/MicroblinkSDK/VideoRecognizer.ts#L598

Can you confirm that this is the case or do we miss something and there is a way to handle this outcome?

vjekoart commented 3 years ago

Hi @sveres,

Thank you for the report.

Could you clarify what you mean by "enabling barcode reading"? Does that mean that you're using the IdBarcodeRecognizer, or you're enabling specific options on the BlinkIdRecognizer?

Regardless of your use case, we're going to look into the error handling system of the VideoRecognizer class to ensure that it can properly handle all errors.

Sincerely, Vjekoslav

sveres commented 3 years ago

Hi @vjekoart,

What I meant is we already use IdBarcodeRecognizer in our app for uploaded images and in a recent release we wanted to enable the same for video feed. Hope that makes sense. I am happy to provide any more info if something is not clear.

Please let me know when will have an ETA.

vjekoart commented 3 years ago

Hi @sveres,

Thank you for the information. I think that is all we need to try and reproduce the issue.

After we can consistently reproduce the issue and find the root cause, we'll be able to make an ETA. That should happen during the next week.

Also, we'll communicate the progress of #46 and #47 in this issue since it looks like they are all related.

Sincerely, Vjekoslav

vjekoart commented 3 years ago

Hi @sveres,

Just letting you know that we're working on a solution, and we're going to publish a hotfix release. We're targeting to solve this problem by the end of the week.

Sincerely, Vjekoslav

sveres commented 3 years ago

Hi @vjekoart ,

Thanks for letting me know, we can't wait to get the fix :)

mburrett-jumio commented 3 years ago

Hi @vjekoart, do you have any updates on this one? Thanks, Mark

vjekoart commented 3 years ago

Hi @mburrett-jumio,

We're currently working on this problem. The current estimation is that we should solve this issue sometime this week or in the worst-case scenario during the next week.

Sincerely, Vjekoslav

vjekoart commented 3 years ago

Hi @sveres, @mburrett-jumio,

We've released a new version of BlinkID, 5.12, in which we changed the logic regarding error handling in VideoRecognizer class.

We've managed to catch all errors with the new mechanisms. Could you make the update on your side and test out the latest version to see if everything is working as expected?

Sincerely, Vjekoslav

sveres commented 3 years ago

Hi @vjekoart ,

We will start to upgrade and the testing soon. Although https://github.com/BlinkID/blinkid-in-browser/issues/52 might block us from releasing, unless we can find a solution either within our implementation or as a new feature.

I took a look at the changes and it seems promising, thank you. We will get back to you once we had the chance to try it out.