Commit ba01981
authored
fix: existing EVM permissions removed when a Solana Wallet Standard connection is rejected (#36283)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
When a dapp connects to MetaMask via EVM and the user *rejects a
subsequent connection request for SVM*, the *existing EVM connection is
closed*. This can potentially break dapp flows and edge cases where
maintaining the EVM connection is critical.
To fix this, we implemented partial revoking into the
`wallet_revokeSession` handler on
MetaMask/core#6668 so that we can then update
our solana wallet-standard provider would only revoke the solana scopes
when it is asked to disconnect, here
MetaMask/solana-wallet-standard#53.
This PR bumps all necessary packages for this to take place, fixing the
undesired EVM permissions revoke when a solana wallet standard
connection is refused.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
[](https://codespaces.new/MetaMask/metamask-extension/pull/36283?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixes existing EVM permissions removed when a Solana
Wallet Standard connection is rejected
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/WAPI-413
## **Manual testing steps**
1. Go to https://orca.so
2. On dev tools console, call `window.ethereum.enable()`
3. Proceed with permission (make sure _NO PERMISSIONS for Solana are
checked_) and confirm
4. Click "Connect Wallet" button, choose "MetaMask" and proceed.
5. When wallet UI prompts to accept connection, click "Cancel" button.
6. Now, on dev tools console, call
```
await window.ethereum.request({
"method": "wallet_getPermissions",
"params": [],
});
```
7. Permission for `eth_accounts` should still be present with the
permitted account in `caveats` array.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
https://github.com/user-attachments/assets/77026a60-03e1-4293-ad8a-25f9c9c5056d
### **After**
https://github.com/user-attachments/assets/e4bca63c-3e21-4736-88fc-6d35f723d90a
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.1 parent 05be1ce commit ba01981
3 files changed
+80
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7304 | 7304 | | |
7305 | 7305 | | |
7306 | 7306 | | |
| 7307 | + | |
| 7308 | + | |
| 7309 | + | |
| 7310 | + | |
7307 | 7311 | | |
7308 | 7312 | | |
7309 | 7313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | | - | |
| 324 | + | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5633 | 5633 | | |
5634 | 5634 | | |
5635 | 5635 | | |
5636 | | - | |
5637 | | - | |
5638 | | - | |
| 5636 | + | |
| 5637 | + | |
| 5638 | + | |
5639 | 5639 | | |
5640 | 5640 | | |
5641 | | - | |
5642 | | - | |
| 5641 | + | |
| 5642 | + | |
5643 | 5643 | | |
5644 | 5644 | | |
5645 | 5645 | | |
5646 | 5646 | | |
5647 | | - | |
| 5647 | + | |
5648 | 5648 | | |
5649 | 5649 | | |
5650 | 5650 | | |
| |||
6021 | 6021 | | |
6022 | 6022 | | |
6023 | 6023 | | |
| 6024 | + | |
| 6025 | + | |
| 6026 | + | |
| 6027 | + | |
| 6028 | + | |
| 6029 | + | |
| 6030 | + | |
| 6031 | + | |
| 6032 | + | |
| 6033 | + | |
| 6034 | + | |
| 6035 | + | |
| 6036 | + | |
6024 | 6037 | | |
6025 | 6038 | | |
6026 | 6039 | | |
| |||
6326 | 6339 | | |
6327 | 6340 | | |
6328 | 6341 | | |
6329 | | - | |
6330 | | - | |
6331 | | - | |
| 6342 | + | |
| 6343 | + | |
| 6344 | + | |
6332 | 6345 | | |
6333 | 6346 | | |
6334 | 6347 | | |
6335 | | - | |
6336 | | - | |
| 6348 | + | |
| 6349 | + | |
6337 | 6350 | | |
6338 | 6351 | | |
6339 | 6352 | | |
| |||
6687 | 6700 | | |
6688 | 6701 | | |
6689 | 6702 | | |
6690 | | - | |
6691 | | - | |
6692 | | - | |
6693 | | - | |
| 6703 | + | |
| 6704 | + | |
| 6705 | + | |
| 6706 | + | |
6694 | 6707 | | |
6695 | 6708 | | |
6696 | 6709 | | |
6697 | | - | |
6698 | | - | |
6699 | | - | |
| 6710 | + | |
| 6711 | + | |
| 6712 | + | |
6700 | 6713 | | |
6701 | 6714 | | |
6702 | | - | |
6703 | | - | |
6704 | | - | |
6705 | | - | |
| 6715 | + | |
| 6716 | + | |
| 6717 | + | |
| 6718 | + | |
6706 | 6719 | | |
6707 | 6720 | | |
6708 | | - | |
| 6721 | + | |
6709 | 6722 | | |
6710 | 6723 | | |
6711 | 6724 | | |
6712 | | - | |
| 6725 | + | |
6713 | 6726 | | |
6714 | 6727 | | |
6715 | 6728 | | |
| |||
6766 | 6779 | | |
6767 | 6780 | | |
6768 | 6781 | | |
6769 | | - | |
| 6782 | + | |
6770 | 6783 | | |
6771 | 6784 | | |
6772 | 6785 | | |
| |||
6794 | 6807 | | |
6795 | 6808 | | |
6796 | 6809 | | |
| 6810 | + | |
| 6811 | + | |
| 6812 | + | |
| 6813 | + | |
| 6814 | + | |
| 6815 | + | |
| 6816 | + | |
| 6817 | + | |
| 6818 | + | |
| 6819 | + | |
| 6820 | + | |
| 6821 | + | |
| 6822 | + | |
| 6823 | + | |
| 6824 | + | |
| 6825 | + | |
| 6826 | + | |
| 6827 | + | |
| 6828 | + | |
| 6829 | + | |
| 6830 | + | |
| 6831 | + | |
| 6832 | + | |
| 6833 | + | |
| 6834 | + | |
| 6835 | + | |
| 6836 | + | |
| 6837 | + | |
6797 | 6838 | | |
6798 | 6839 | | |
6799 | 6840 | | |
| |||
7428 | 7469 | | |
7429 | 7470 | | |
7430 | 7471 | | |
7431 | | - | |
7432 | | - | |
7433 | | - | |
| 7472 | + | |
| 7473 | + | |
| 7474 | + | |
7434 | 7475 | | |
7435 | 7476 | | |
7436 | 7477 | | |
7437 | 7478 | | |
7438 | 7479 | | |
7439 | 7480 | | |
7440 | 7481 | | |
7441 | | - | |
| 7482 | + | |
7442 | 7483 | | |
7443 | 7484 | | |
7444 | 7485 | | |
| |||
31947 | 31988 | | |
31948 | 31989 | | |
31949 | 31990 | | |
31950 | | - | |
31951 | | - | |
| 31991 | + | |
| 31992 | + | |
31952 | 31993 | | |
31953 | 31994 | | |
31954 | 31995 | | |
| |||
31982 | 32023 | | |
31983 | 32024 | | |
31984 | 32025 | | |
31985 | | - | |
| 32026 | + | |
31986 | 32027 | | |
31987 | 32028 | | |
31988 | 32029 | | |
| |||
0 commit comments