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

[Bug]: ndefreader should't stop scanning immediately after the card is read. #4807

Closed
1 task done
JssDWt opened this issue Mar 23, 2023 · 2 comments · Fixed by #4819
Closed
1 task done

[Bug]: ndefreader should't stop scanning immediately after the card is read. #4807

JssDWt opened this issue Mar 23, 2023 · 2 comments · Fixed by #4819

Comments

@JssDWt
Copy link

JssDWt commented Mar 23, 2023

What is your BTCPay version?

I'm not actually running BTCPay, just reporting an issue.

How did you deploy BTCPay Server?

The issue is on a POS device in the browser.

What happened?

Some people run into the issue that another app opens when someone pays with an NFC card. This is because when the ndefreader scan is aborted, the OS takes over the nfc scan. The card will be read again and the default app to handle the link on the card will be opened (sometimes it's the 'choose app' screen).

You'll probably want to stop scanning after a few seconds or so, when the card has been removed from the reader, before stopping the scan.

How did you encounter this bug?

I'm not sure about the exact steps.

Relevant log output

No response

What browser do you use?

No response

Additional information

No response

Are you sure this is a bug report?

  • I confirm this is a bug report
@titusz
Copy link

titusz commented Mar 23, 2023

I can confirm the issue on BTCPay v1.8.4+fadb05e97

@titusz
Copy link

titusz commented Mar 23, 2023

This illustrates the issue.

btcpay-nfc-bug-4807.mp4

If you remove the tag faster you may get lucky and it does not happen. I am not sure if/how this can be prevented. But it would help to give an audio signal instantly when the tag has been read so the user can remove the tag. Maybe it is possible to only release the handler to the NFC reader after it is out of reach?

dennisreimann added a commit to dennisreimann/btcpayserver that referenced this issue Mar 27, 2023
Two changes which fix btcpayserver#4807:

- Once permissions are granted we start scanning immediately, no need to ask for permissions or have the user click the button again
- We don't abort the scan, which gets rid of the cases in which the OS took over after the scan, because the user left the card on the device

Also adds feedback for the NFC states scanning and submitting.
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 a pull request may close this issue.

2 participants