eroself / vaadin-litelement-zxing

ZXing integration on Vaadin 14
MIT License
0 stars 4 forks source link

NotFoundException2: No MultiFormat Readers were able to detect the code. #20

Closed mvysny closed 6 months ago

mvysny commented 7 months ago

I'm getting this error for every frame: NotFoundException2: No MultiFormat Readers were able to detect the code.. I assume that this is the normal modus operandi for ZXing when it can't detect the QR code in the video stream, and therefore we should exclude it from reporting to the server.

According to https://github.com/mebjas/html5-qrcode/issues/320, this only happens with webpack, so I'm assuming that webpack changes the class name of the exception and it's not caught by this.excludes. I'd propose to exclude this exception from reporting it to the server-side, but I'd exclude it only if the error message matches as well, otherwise we might accidentally not report other valid NotFoundExceptions as well.

This is a serious issue since this has the potential to overwhelm the server with calls if multiple users open their cameras, akin to DDOS. This needs to be fixed fast.

mvysny commented 6 months ago

Uh-oh, the fix doesn't work properly when compiling for production: I'm getting "l: No MultiFormat Readers were able to detect the code.". Note the error name "l" - lowercase L character. I assume that the name/type of the error is mangled/obfuscated by webpack. We'll need to match based on the message only.

mvysny commented 6 months ago

Also I'm frequently getting "DOMException: IndexSizeError : Index or size is negative or greater than the allowed amount", let's add an ignore clause for that as well.