Skip to content

Conversation

ffmcgee725
Copy link
Member

Explanation

Uniswap reported a bug in slack here where MetaMask was unpermitting any EVM connections for a dapp if that dapp used the solana wallet standard provider to make a connect request and then cancelled it.

This call to disconnect() is happening outside of our packages and is not related to a previous but similar bug where our own wallet-standard provider was calling wallet_revokeSession when receiving an empty solana accountsChanged event.

To fix this, this PR proposes an implementation for partial permission revoking in the wallet_revokeSession handler so that we can then update our solana wallet-standard provider to only revoke the solana scopes when it is asked to disconnect.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@ffmcgee725 ffmcgee725 marked this pull request as ready for review September 22, 2025 10:57
@ffmcgee725 ffmcgee725 requested review from a team as code owners September 22, 2025 10:57
cursor[bot]

This comment was marked as outdated.

Comment on lines 32 to 33
* @param hooks.updateCaveat -
* @param hooks.getCaveatForOrigin -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param hooks.updateCaveat -
* @param hooks.getCaveatForOrigin -
* @param hooks.updateCaveat - hook used to conditionally update the caveat rather than fully revoke the permission
* @param hooks.getCaveatForOrigin - hook to fetch an existing caveat for the origin of the request

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
) {
const {
params: { sessionScopes },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

Suggested change
params: { sessionScopes },
params: { scopes },

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theoretically this is why we should propse a change to the caip first. But I'm fine with us rolling on it here first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


try {
hooks.revokePermissionForOrigin(Caip25EndowmentPermissionName);
if (scopes?.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we pass an empty array of scopes, what should happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (scopes?.length) evaluates to false, so we fully revoke the permission. Basically the same as passing an empty params object

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, that's what happens right now, but is that what we want? If i say "hey, please remove the following specific scopes from my permission, nothing", should it remove everything? Idk. anyway not worth blocking on and probably not important right now

Comment on lines 32 to 43
hooks: {
revokePermissionForOrigin: (permissionName: string) => void;
updateCaveat: (
target: string,
caveatType: string,
caveatValue: Caip25CaveatValue,
) => void;
getCaveatForOrigin: (
endowmentPermissionName: string,
caveatType: string,
) => Caveat<typeof Caip25CaveatType, Caip25CaveatValue>;
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. can we DRY these hook types since they are shared with the handler?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cursor[bot]

This comment was marked as outdated.

jiexi
jiexi previously approved these changes Sep 23, 2025
@ffmcgee725 ffmcgee725 enabled auto-merge (squash) September 23, 2025 15:43
cursor[bot]

This comment was marked as outdated.

@ffmcgee725 ffmcgee725 disabled auto-merge September 23, 2025 15:45
@ffmcgee725 ffmcgee725 enabled auto-merge (squash) September 23, 2025 15:56
@ffmcgee725 ffmcgee725 merged commit da8f8fa into main Sep 23, 2025
239 checks passed
@ffmcgee725 ffmcgee725 deleted the jc/WAPI-728 branch September 23, 2025 16:12
@ffmcgee725 ffmcgee725 mentioned this pull request Sep 23, 2025
4 tasks
ffmcgee725 added a commit that referenced this pull request Sep 23, 2025
## Explanation

Release for `@metamask/multichain-api-middleware`

- Add partial permission revoke into `wallet_revokeSession`
([#6668](#6668))
- Bump `@metamask/chain-agnostic-permission` from `1.0.0` to `1.1.1`
([#6241](#6241),
[#6345](#6241))
- Bump `@metamask/controller-utils` from `^11.10.0` to `^11.14.0`
([#6069](#6069),
[#6303](#6303),
[#6620](#6620),
[#6629](#6629))
- Bump `@metamask/network-controller` from `^24.0.0` to `^24.2.0`
([#6148](#6148),
[#6303](#6303),
[#6678](#6678))
- Bump `@metamask/utils` from `^11.2.0` to `^11.4.2`
([#6054](#6054))
- Bump `@metamask/utils` from `^11.4.2` to `^11.8.0`
([#6588](#6588))
- Bump `@metamask/json-rpc-engine` from `^10.0.3` to `^10.1.0`
([#6678](#6678))

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

* Fixes https://consensyssoftware.atlassian.net/browse/WAPI-728

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 24, 2025
…onnection 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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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.
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 24, 2025
…onnection 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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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.
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 24, 2025
…onnection 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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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.
jeffsmale90 pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 24, 2025
…onnection 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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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.
jeffsmale90 pushed a commit to MetaMask/metamask-extension that referenced this pull request Sep 24, 2025
…onnection 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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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.
github-merge-queue bot pushed a commit to MetaMask/metamask-mobile that referenced this pull request Sep 25, 2025
…onnection is rejected (#20309)

<!--
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?
-->

## **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**

```gherkin
Feature: fix EVM permmissions removed when Solana Wallet Standard connection rejected

  Scenario: user rejects Solana Wallet Standard connection
    Given there are existing EVM permissions for the dapp

    When user rejects Solana Wallet Standard connection
    Then EVM permissions should still exist, and not be revoked
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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.
weitingsun pushed a commit to MetaMask/metamask-mobile that referenced this pull request Oct 15, 2025
…onnection is rejected (#20309)

<!--
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?
-->

## **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**

```gherkin
Feature: fix EVM permmissions removed when Solana Wallet Standard connection rejected

  Scenario: user rejects Solana Wallet Standard connection
    Given there are existing EVM permissions for the dapp

    When user rejects Solana Wallet Standard connection
    Then EVM permissions should still exist, and not be revoked
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants