Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing callback on error in decodeFromInputVideoDevice #175

Closed
DrorBuhnik opened this issue Mar 19, 2019 · 5 comments · Fixed by #197
Closed

Missing callback on error in decodeFromInputVideoDevice #175

DrorBuhnik opened this issue Mar 19, 2019 · 5 comments · Fixed by #197
Labels
bug P1 Urgent issue that should be resolved before the next re-lease

Comments

@DrorBuhnik
Copy link

Where there is an issue inside decodeFromInputVideoDevice, the error is not propagate up via scanFailure observable, this leave the library user in undefined state without any option to recover
https://github.com/zxing-js/ngx-scanner/blob/master/src/app/modules/zxing-scanner/browser-code-reader.ts#L143-L146

This came up when testing on iPad which (for some reason known only to apple) doesn't like to use the back ("environment") camera

To Reproduce

  1. Find the environment camera (via this.scanner.camerasFound.subscribe)
  2. Instruct ngx-scanner to use the environment camera (e.g. if label contains 'back' string)
  3. Get an error in console:
    OverconstrainedError { message: "Invalid constraint", constraint: "deviceId" }
  4. No other feedback, no knowledge is passed to library user in any callback/observables

Expected behavior
The library user should receive an error via scanFailure observable

Smartphone
Device: Apple iPad Mini 2
OS: 12.1.4
Browser: Safari
Version: 12

@odahcam odahcam added the bug label Mar 19, 2019
@odahcam
Copy link
Member

odahcam commented Mar 19, 2019

I can confirm this behavior once I experienced it lots of times in recently. I'm sorry I couldn't fix it yet, I'm pretty out of time.

@odahcam odahcam added the P1 Urgent issue that should be resolved before the next re-lease label Mar 19, 2019
@DrorBuhnik
Copy link
Author

Right now I have a manual workaround that takes this code

} catch (err) {
/* handle the error, or not */
console.error(err);
}

and add

            catch (err) {
                /* handle the error, or not */
                console.error(err);
                callbackFn();
            }

Is that a sufficient fix for you?

@lock
Copy link

lock bot commented Jun 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

2 similar comments
@lock
Copy link

lock bot commented Jun 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock
Copy link

lock bot commented Jun 24, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug P1 Urgent issue that should be resolved before the next re-lease
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants