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

Reject all pending confirmations when notification window closed #10302

Closed
Gudahtt opened this issue Jan 28, 2021 · 1 comment · Fixed by #12643
Closed

Reject all pending confirmations when notification window closed #10302

Gudahtt opened this issue Jan 28, 2021 · 1 comment · Fixed by #12643

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Jan 28, 2021

We should reject all pending confirmations when the notification window is closed.

We already consider closing the notification window to be a rejection of the confirmation currently being shown. However if the user has multiple pending confirmations, closing the notification window only rejects the first one. This can be confusing the next time the user triggers a new confirmation, because they end up getting presented with the old one instead. This can also be confusing when the user closes the notification window on the lock screen, which currently leaves any confirmations pending without rejecting anything.

Rejecting all pending confirmations upon closing the notification window would further cement the idea that closing the window is a rejection, and it would help prevent the build-up of stale confirmations that are no longer of interest to the user.

@MWaser
Copy link

MWaser commented Mar 10, 2021

Is there any word on when this will be implemented?

Your own documentation at https://docs.metamask.io/guide/ethereum-provider.html#using-the-provider (see below)
gave us an expectation of a 4001 error when the user closes the window.

This is turning into a huge show-stopper for us. We are trying to migrate from web3 and this has us blocked.
Is there something we can do in the interim (other than having a bunch of novice users load the obsolete-metamask fix)?

function connect() {
ethereum
.request({ method: 'eth_requestAccounts' })
.then(handleAccountsChanged)
.catch((err) => {
if (err.code === 4001) {
// EIP-1193 userRejectedRequest error
// If this happens, the user rejected the connection request.
console.log('Please connect to MetaMask.');
} else {
console.error(err);
}
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants