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

The scanner should display a snackbar "Not a valid product barcode" when we scan a QR-Code #840

Closed
1 task
teolemon opened this issue Jan 3, 2022 · 13 comments
Labels
🎯 P1 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Milestone

Comments

@teolemon
Copy link
Member

teolemon commented Jan 3, 2022

What

  • add just a snackbar "Not a valid product barcode" when we scan a QR-Code

Old discussion

  • Decide what we do when we scan a QR-Code
  • I tried to add it. And now, I have a grey screen in lieu of History again.
  • Do we fail silently ? Do we say "Please scan the barcode instead, or if there's no barcode on the packaging, click the button below to open the URL in a web browser" ?

Screenshot

image

Part of

@monsieurtanuki
Copy link
Contributor

Different answers:

  • should we accept QR code? I don't think so. Probably a matter of set up in the scan library.
  • does it also crash when it's an unknown barcode?

@monsieurtanuki
Copy link
Contributor

Suggested fix:

  Future<void> onScan(final Barcode barcode) async {
    if (barcode.code == null) {
      return;
    }
    if (barcode.format != BarcodeFormat.ean13) { // just added a check on the format
      return;
    }
    final String code = barcode.code!;
    if (_barcodeTrustCheck != code) {
      _barcodeTrustCheck = code;
      return;
    }
    if (_latestScannedBarcode == code) {
      return;
    }
    _latestScannedBarcode = code;
    _addBarcode(code);
  }

@M123-dev
Copy link
Member

M123-dev commented Feb 20, 2022

should we accept QR code? I don't think so. Probably a matter of set up in the scan library.

It is probably not difficult to add another qr_code_card which is just a bit more compfort for the user, everything is better then just showing nothing if we scan barcodes non the less

@M123-dev
Copy link
Member

Also we could call UrlLauncher.canLaunch and if true even allow to open the barcode link

@VaiTon
Copy link
Member

VaiTon commented Mar 29, 2022

Also we could call UrlLauncher.canLaunch and if true even allow to open the barcode link

I don't think that's good for user security. There are app to open QR codes and we're not one of them.

It is probably not difficult to add another qr_code_card which is just a bit more compfort for the user, everything is better then just showing nothing if we scan barcodes non the less

Maybe we could add just a snackbar "Not a valid product barcode".

@teolemon
Copy link
Member Author

I'm ok with that solution. Renaming the bug accordingly

@teolemon teolemon changed the title Decide what we do when we scan a QR-Code add just a snackbar "Not a valid product barcode" when we scan a QR-Code Apr 28, 2022
@teolemon teolemon added this to the V1 milestone Apr 28, 2022
@teolemon
Copy link
Member Author

@mse-moises What about this one ?

@mse-moises
Copy link
Contributor

Sure, assign me and I'll start working on it after I finish the one that i doing right now.

@teolemon teolemon added 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion… and removed scanning labels May 8, 2022
@VaiTon VaiTon changed the title add just a snackbar "Not a valid product barcode" when we scan a QR-Code The scanner should display a snackbar "Not a valid product barcode" when we scan a QR-Code Jun 5, 2022
@VaiTon
Copy link
Member

VaiTon commented Jun 7, 2022

@mse-moises any news on this one?

@mse-moises
Copy link
Contributor

@VaiTon In the pull request #1739, the team came to the conclusion that it was no longer needed.

@M123-dev
Copy link
Member

M123-dev commented Jun 7, 2022

I think the implementation of not accepting qr codes was no londer needes as @g123k did a lot of refactoring and included this. I'd say a snackbar still makes sense

@g123k
Copy link
Collaborator

g123k commented Jun 7, 2022

Indeed, we don't detect Qr codes anymore. So we can't know if it is a Qr code or not 🤪

@VaiTon
Copy link
Member

VaiTon commented Jun 7, 2022

Indeed, we don't detect Qr codes anymore. So we can't know if it is a Qr code or not 🤪

Ok, so we only detect valid barcodes? If that is true we can close this! @g123k

@g123k g123k closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 P1 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Development

Successfully merging a pull request may close this issue.

6 participants