Commit 0e035f9
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 0a2c425 commit 0e035f9
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 | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
| 325 | + | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5648 | 5648 | | |
5649 | 5649 | | |
5650 | 5650 | | |
5651 | | - | |
5652 | | - | |
5653 | | - | |
| 5651 | + | |
| 5652 | + | |
| 5653 | + | |
5654 | 5654 | | |
5655 | 5655 | | |
5656 | | - | |
5657 | | - | |
| 5656 | + | |
| 5657 | + | |
5658 | 5658 | | |
5659 | 5659 | | |
5660 | 5660 | | |
5661 | 5661 | | |
5662 | | - | |
| 5662 | + | |
5663 | 5663 | | |
5664 | 5664 | | |
5665 | 5665 | | |
| |||
6079 | 6079 | | |
6080 | 6080 | | |
6081 | 6081 | | |
| 6082 | + | |
| 6083 | + | |
| 6084 | + | |
| 6085 | + | |
| 6086 | + | |
| 6087 | + | |
| 6088 | + | |
| 6089 | + | |
| 6090 | + | |
| 6091 | + | |
| 6092 | + | |
| 6093 | + | |
| 6094 | + | |
6082 | 6095 | | |
6083 | 6096 | | |
6084 | 6097 | | |
| |||
6399 | 6412 | | |
6400 | 6413 | | |
6401 | 6414 | | |
6402 | | - | |
6403 | | - | |
6404 | | - | |
| 6415 | + | |
| 6416 | + | |
| 6417 | + | |
6405 | 6418 | | |
6406 | 6419 | | |
6407 | 6420 | | |
6408 | | - | |
6409 | | - | |
| 6421 | + | |
| 6422 | + | |
6410 | 6423 | | |
6411 | 6424 | | |
6412 | 6425 | | |
| |||
6760 | 6773 | | |
6761 | 6774 | | |
6762 | 6775 | | |
6763 | | - | |
6764 | | - | |
6765 | | - | |
6766 | | - | |
| 6776 | + | |
| 6777 | + | |
| 6778 | + | |
| 6779 | + | |
6767 | 6780 | | |
6768 | 6781 | | |
6769 | 6782 | | |
6770 | | - | |
6771 | | - | |
6772 | | - | |
| 6783 | + | |
| 6784 | + | |
| 6785 | + | |
6773 | 6786 | | |
6774 | 6787 | | |
6775 | | - | |
6776 | | - | |
6777 | | - | |
6778 | | - | |
| 6788 | + | |
| 6789 | + | |
| 6790 | + | |
| 6791 | + | |
6779 | 6792 | | |
6780 | 6793 | | |
6781 | | - | |
| 6794 | + | |
6782 | 6795 | | |
6783 | 6796 | | |
6784 | 6797 | | |
6785 | | - | |
| 6798 | + | |
6786 | 6799 | | |
6787 | 6800 | | |
6788 | 6801 | | |
| |||
6839 | 6852 | | |
6840 | 6853 | | |
6841 | 6854 | | |
6842 | | - | |
| 6855 | + | |
6843 | 6856 | | |
6844 | 6857 | | |
6845 | 6858 | | |
| |||
6867 | 6880 | | |
6868 | 6881 | | |
6869 | 6882 | | |
| 6883 | + | |
| 6884 | + | |
| 6885 | + | |
| 6886 | + | |
| 6887 | + | |
| 6888 | + | |
| 6889 | + | |
| 6890 | + | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
| 6898 | + | |
| 6899 | + | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
6870 | 6911 | | |
6871 | 6912 | | |
6872 | 6913 | | |
| |||
7533 | 7574 | | |
7534 | 7575 | | |
7535 | 7576 | | |
7536 | | - | |
7537 | | - | |
7538 | | - | |
| 7577 | + | |
| 7578 | + | |
| 7579 | + | |
7539 | 7580 | | |
7540 | 7581 | | |
7541 | 7582 | | |
7542 | 7583 | | |
7543 | 7584 | | |
7544 | 7585 | | |
7545 | 7586 | | |
7546 | | - | |
| 7587 | + | |
7547 | 7588 | | |
7548 | 7589 | | |
7549 | 7590 | | |
| |||
32085 | 32126 | | |
32086 | 32127 | | |
32087 | 32128 | | |
32088 | | - | |
32089 | | - | |
| 32129 | + | |
| 32130 | + | |
32090 | 32131 | | |
32091 | 32132 | | |
32092 | 32133 | | |
| |||
32121 | 32162 | | |
32122 | 32163 | | |
32123 | 32164 | | |
32124 | | - | |
| 32165 | + | |
32125 | 32166 | | |
32126 | 32167 | | |
32127 | 32168 | | |
| |||
0 commit comments