generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
fix: update #disconnect to not revoke session on Solana disconnect via account changed event #48
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
Merged
baptiste-marchand
merged 2 commits into
main
from
fix/remove-revoke-session-on-account-changed-event
Jul 15, 2025
Merged
fix: update #disconnect to not revoke session on Solana disconnect via account changed event #48
baptiste-marchand
merged 2 commits into
main
from
fix/remove-revoke-session-on-account-changed-event
Jul 15, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…a account changed event
EdouardBougon
approved these changes
Jul 15, 2025
Merged
7 tasks
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Jul 15, 2025
<!-- 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** <!-- 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? --> This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call `wallet_revokeSession` when the Wallet Standard disconnection comes from an `accountsChanged` event. Related change: MetaMask/solana-wallet-standard#48 [](https://codespaces.new/MetaMask/metamask-extension/pull/34281?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: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#5376 Contributes to fixing MetaMask/MetaMask-planning#5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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
Jul 15, 2025
<!-- 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** <!-- 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? --> This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call `wallet_revokeSession` when the Wallet Standard disconnection comes from an `accountsChanged` event. Related change: MetaMask/solana-wallet-standard#48 [](https://codespaces.new/MetaMask/metamask-extension/pull/34281?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: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#5376 Contributes to fixing MetaMask/MetaMask-planning#5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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.
This was referenced Jul 15, 2025
runway-github bot
added a commit
to MetaMask/metamask-extension
that referenced
this pull request
Jul 16, 2025
<!-- 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** <!-- 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? --> This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call `wallet_revokeSession` when the Wallet Standard disconnection comes from an `accountsChanged` event. Related change: MetaMask/solana-wallet-standard#48 [](https://codespaces.new/MetaMask/metamask-extension/pull/34281?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: null ## **Related issues** Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5376 Contributes to fixing https://github.com/MetaMask/MetaMask-planning/issues/5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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.
runway-github bot
added a commit
to MetaMask/metamask-extension
that referenced
this pull request
Jul 16, 2025
<!-- 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** <!-- 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? --> This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call `wallet_revokeSession` when the Wallet Standard disconnection comes from an `accountsChanged` event. Related change: MetaMask/solana-wallet-standard#48 [](https://codespaces.new/MetaMask/metamask-extension/pull/34281?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: null ## **Related issues** Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5376 Contributes to fixing https://github.com/MetaMask/MetaMask-planning/issues/5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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.
runway-github bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Jul 16, 2025
…rd to 0.5.1 (#34281) <!-- 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** <!-- 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? --> This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call `wallet_revokeSession` when the Wallet Standard disconnection comes from an `accountsChanged` event. Related change: MetaMask/solana-wallet-standard#48 [](https://codespaces.new/MetaMask/metamask-extension/pull/34281?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: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#5376 Contributes to fixing MetaMask/MetaMask-planning#5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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.
7 tasks
DDDDDanica
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Jul 16, 2025
## Original PR against main #34281 <!-- 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** <!-- 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? --> This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call `wallet_revokeSession` when the Wallet Standard disconnection comes from an `accountsChanged` event. Related change: MetaMask/solana-wallet-standard#48 [](https://codespaces.new/MetaMask/metamask-extension/pull/34281?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: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#5376 Contributes to fixing MetaMask/MetaMask-planning#5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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
Jul 17, 2025
## **Description** This PR bumps @metamask/solana-wallet-standard to 0.5.1, to fix a bug that was causing disconnection of EVM scopes when removing Solana permissions while being connected with Wallet Standard. The fix is to not call wallet_revokeSession when the Wallet Standard disconnection comes from an accountsChanged event. Related change: MetaMask/solana-wallet-standard#48 ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#5376 Contributes to fixing MetaMask/MetaMask-planning#5158 ## **Manual testing steps** 1. Go to https://metamask.github.io/test-dapp-solana/staging/ 2. Connect with both an EVM and a Solana account 3. Disconnect the Solana account from MetaMask by editing the permissions 4. EVM account should still be connected ## **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/5d94e168-167c-4e61-b41f-ed0d72b600ec ### **After** https://github.com/user-attachments/assets/8f147b29-246d-47d9-a72c-d86523357c7c ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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. Co-authored-by: Alex Donesky <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the disconnect logic to not revoke the session when called from an account changed event, while still revoking the session when called from the
StandardDisconnect
feature.It fixes a bug where EVM scopes where being disconnected when removing all the Solana accounts from a session in MetaMask.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5376
Contributes to fixing https://github.com/MetaMask/MetaMask-planning/issues/5158
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2025-07-15.at.11.24.15.mov
After
Screen.Recording.2025-07-15.at.11.26.58.mov