prax-wallet / web

https://praxwallet.com
Apache License 2.0
3 stars 2 forks source link

Subsequent approval requests declined #120

Closed grod220 closed 2 weeks ago

grod220 commented 1 month ago

After denial of approval popup, a second request gets swallowed without a response. It requires a page reload to reset the state to try again. This behavior has confused some external consumers. Todo: Do not require page reloads for subsequent requests.

https://github.com/user-attachments/assets/cfec112c-6a60-4550-b369-4ad074ac44a3

turbocrime commented 1 month ago

each subsequent request will return the same result as the first request

within the document lifecycle, an approved request will result in the success of all subsequent requests, and a denied request will result in the denial of all subsequent requests.

this is deliberate - it makes spamming requests impossible, because a document can only make a request once in its lifecycle.

grod220 commented 1 month ago

The current userflow in the video is one we can anticipate from all of the frontends. It feels broken. @plaidfinch, was able to work around this by triggering a full page reload upon denial. However, this feels quite hacky. We should have a more supported behavior for subsequent requests.

plaidfinch commented 1 month ago

If you want to spam approval requests you can trigger a refresh loop using the malicious version of the hack I did. I don't think this protection is meaningful — the extension already has a "ignore" button when a site makes multiple connection requests, and this seems sufficient?

plaidfinch commented 1 month ago

As a user, I want to be able to disconnect my wallet and reconnect it later, or change my mind about whether to approve the page, without losing my scroll context and other page state (side effect of the hack to work around this behavior).

turbocrime commented 2 weeks ago

this is confirmed working

https://github.com/user-attachments/assets/35d88c36-916a-4e39-872c-0d924932f52c