-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix: mm request permissions on request accounts pending #656
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
ef411a8
to
32b94e8
Compare
2ea5ed9
to
08db6cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes a really annoying UX moderately annoying 🙏
Played with wallet_requestPermissions
and confirmed it does what we want it to do by forcing the Metamask window to open (albeit forcing the user to reselect accounts, but it's a definite improvement nonetheless!).
See MetaMask/metamask-extension#10085 for reference
tl;dr is MM API doesn't make any sense, and doesn't allow for
eth_requestAccounts
requests if there's already a pending one. This will throw errors and make users unable to unlock their wallet, effectively being in an infinite loop.Having request/s pending could happen if users dismissed previous connection requests and/or wallet unlock, or worse, if MM popup never properly popped up and discretely went with a notification instead (which can sometimes happen and is out of our control).
This PR uses
wallet_requestPermissions
instead when the former failed. That will ensure MM properly pops up when it should, the downside of this being users will have to "reconnect" accounts even if they're already connected.Screenshots
(Don't mind the slowness / snap UI missing, this was with localhost debugging)
Untitled.mov
Issue
Relates to web's shapeshift/web#5453