-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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]: Pending confirmations should be cleared on reload #22375
Comments
Hi @bschorchit @kevinghim would you say this belongs to the scope of the confirmations team or UX team? |
Further context describing what I referred to as "current behavior": |
@bschorchit can your team look into? |
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions. |
Describe the bug
Currently, pending confirmations are cleared if the notification window is closed and/or if a request is explicitly rejected by the user. However, if the window is reloaded while the notification window is displayed, the confirmation will remain pending which can be problematic. Below I attempt to describe how this is problematic and some possible solutions.
If the window is reloaded whilst the notification window is open, it's not immediately obvious to the user that their wallet needs their input after the fact. Although the extension's badge is displayed, it could mean any number of things and in any case, it is not very prominent due to the limited space (if any) that an extension icon occupies on the average browser.
At this point any and all new requests will result in an error because the wallet is stuck in a "pending confirmation" state.
Ideally a reload whilst the notification window is open should result in a rejection, which in my opinion would match the current behavior of interpreting the closing of the notification window as a rejection.
In the absence of the above, then it would be helpful to have the ability to programmatically cancel pending confirmations originated by a specific
origin
so that developers can work around the "pending confirmation" state.At the moment, it is possible to react to the "stuck" state by catching the accompanying error thrown when a new request is sent whilst a previous one is pending:
{code: -32002, message: "Request of type 'wallet_requestPermissions' already pending for for origin [ORIGIN]. Please wait."
However, it's not really feasible to react elegantly to it from a UX perspective since it's not possible to cancel pending confirmations. Even if we were to ask the user to do something about it (e.g. "Please click on the extension, and cancel or approve the request") the application has no way of being notified by the wallet that a previously issued request has been approved/rejected. That said, asking the user to address the "stuck state" would still be preferable to the current status quo as it would allow the application to inform the user that they need to reload the application in order to align both the wallet and the application states.
Expected behavior
Summarizing, one or all of the following could help in dealing with this scenario:
Screenshots/Recordings
The Uniswap app does not know about pending confirmation, nor is it able to restart the process

Previously issued confirmation has been confirmed, but the Uniswap app is unaware

Steps to reproduce
Finally steps to reproduce and observe the behavior:
Connect
button in the upper rightMetaMask
from the list of walletsConnect
button in the upper right againMetaMask
from the list of wallets again-32002
(mentioned above) in your consoleHopefully all of this highlights how this is problematic and not conducive to good UX, and while we are at it let's do the following in order to emphasize the issue:
Error messages or log output
Version
11.7.1
Build type
Beta
Browser
Firefox, Brave
Operating system
Linux
Hardware wallet
No response
Additional context
No response
Severity
No response
The text was updated successfully, but these errors were encountered: