-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: codeScanner unsupported ios version error handing #3175
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
} catch let CameraError.codeScanner(codeScannerError) { | ||
switch codeScannerError { | ||
case .iosVersionNotSupported: | ||
VisionLogger.log(level: .warning, message: codeScannerError.message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no point in throwing an error if we just ignore it later.
Please add the ios-version-not-supported
error to the TypeScript error types, and then in here we just let the error propagate upwards for the user to handle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then hmm he will just ignore it later anyways as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to propagate the error to the JS side? In that case, the onError
callback will fire, and the user can handle the error. However, the user might assume that this callback fired because the camera failed to start and cannot operate, leading them to show an error screen, for instance. But the scanner can still operate.
I can refactor the solution without throwing an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've refactored without throwing an error. Also i've added supported code types table to the docs
a88ac82
to
6492ba4
Compare
6492ba4
to
99cacac
Compare
Hi @mrousavy . I hope you're doing well! I have updated PR, can you review it please? |
What
Enabling
codabar
format in code scanner is dangerousScenario: You set up the code scanner with several formats, including
codabar
. On Android and iOS 15.4 and above, everything works well. However, on iOS 15.3 or below, you get a black screen, and the scanner doesn't work at all.Changes
On iOS 15.3 or below, if you enable an unsupported code scanner format (e.g.,
codabar
), the scanner works without this format, instead of a black screen.Tested on
Related issues