cashubtc / eNuts

A Cashu wallet for Android and iOS 🥜🐿️
https://enuts.cash
GNU General Public License v3.0
189 stars 25 forks source link

[BUG] Allow paste keeps prompting on iOS #164

Closed L0laL33tz closed 1 year ago

L0laL33tz commented 1 year ago

I have a url copied in my clipboard from safari. eNuts keeps prompting me with the allow paste popup on iOS even after I click "don't allow paste".

Steps to reproduce the behavior:

  1. Copy random link from Safari
  2. Open eNuts
  3. Click "don't allow paste"
  4. See bug

https://github.com/cashubtc/eNuts/assets/54821950/08c0a8d7-f6d1-4aa7-aacb-d7db27781fbf

KKA11010 commented 1 year ago

Thanks for reporting. Will reproduce and address this asap

KKA11010 commented 1 year ago

@L0laL33tz does it appears more than 2 times, like all the time?

L0laL33tz commented 1 year ago

For me it appeared about 6-7 times and also persisted after restarting the app – it stopped after i clicked on "allow paste"

KKA11010 commented 1 year ago

The app monitors your clipboard for a Cashu token each time it returns to the foreground (for a quick redemption). It appears that iOS prompts the user whenever the app accesses the clipboard, even though it only checks and doesn't perform any pasting actions. If you choose to disallow access, this restriction applies for the current instance only, and the clipboard check will be skipped. However, note that the app will continue to perform clipboard checks in subsequent instances, even if you had previously disallowed access.

KKA11010 commented 1 year ago

Some user are reporting issues that it even freezes the app and makes it unusable on ios (checking for token in clipboard after coming to the foreground)

L0laL33tz commented 1 year ago

Yeah this was my experience as well – It just continues to pop up. If it wasn't clear: even if I click disallow, it does not remember my decision for the same instance and continues to prompt as in the video attached to the issue.

KKA11010 commented 1 year ago

Yeah this was my experience as well – It just continues to pop up. If it wasn't clear: even if I click disallow, it does not remember my decision for the same instance and continues to prompt as in the video attached to the issue.

This occurs because the check currently happens in a loop of 10 attempts, each attempt beeing its own instance. (Clipboard is not immediatly available the after app comes to the foreground)

This current implementation has to be definetly changed and improved.

🤝