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

fix: with the "noDuplicates", the same code is no longer detected after stopping and restarting the scanner #839

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

pgeof
Copy link

@pgeof pgeof commented Oct 30, 2023

This PR proposes a fix for the issue reported here #750, which I also encountered.

To summarize, we reset the variable that holds the list of recently scanned codes every time the mobile scanner controller is restarted. I also sorted the list to avoid false comparisons of lists with the same codes but in a different order.

Additionally, on iOS, I had a code that was being spammed even though the "noDuplicates" speed was enabled. Upon reviewing the code, I noticed that this occurred when an empty code list was returned by the scanner, which happens as soon as there are no more codes in the camera's field of view. So I added a check to ignore empty lists. In fact, this check was already present in the Android code.

…ger detected after stopping and restarting the scanner.

Fix: spamming code detection with "noDuplicates" detection speed on iOS.
@pgeof pgeof changed the title Fix: with the "noDuplicates" detection speed, the same code is no lon… fix: with the "noDuplicates" detection speed, the same code is no lon… Oct 30, 2023
@pgeof pgeof changed the title fix: with the "noDuplicates" detection speed, the same code is no lon… fix: with the "noDuplicates", the same code is no longer detected after stopping and restarting the scanner Oct 30, 2023
@pgeof pgeof marked this pull request as ready for review October 30, 2023 20:09
Copy link
Collaborator

@navaronbracke navaronbracke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the same fix for MacOS ? Since that uses Apple's Vision API, the behavior might be different. We also do not keep track of a barcodes string there, so this might not be needed.

@navaronbracke
Copy link
Collaborator

Just tested this with the repro steps from the issue and MacOS works fine with noDuplicates.

@navaronbracke navaronbracke merged commit c1bb1ca into juliansteenbakker:master Oct 31, 2023
6 of 7 checks passed
@pgeof
Copy link
Author

pgeof commented Nov 2, 2023

Just tested this with the repro steps from the issue and MacOS works fine with noDuplicates.

I must admit I did not think about macOS and the Vision API, but thank you for validating that!

joaopedro735 pushed a commit to joaopedro735/mobile_scanner that referenced this pull request Aug 22, 2024
fix: with the "noDuplicates", the same code is no longer detected after stopping and restarting the scanner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants