Conversation
…wallet` namespace case
isInternalAccountInPermittedAccountIds case where only wallet:eip155 permission exists for a given address
jiexi
approved these changes
Jun 13, 2025
jiexi
previously approved these changes
Jun 13, 2025
jiexi
previously approved these changes
Jun 13, 2025
jiexi
approved these changes
Jun 13, 2025
Merged
adonesky1
added a commit
that referenced
this pull request
Jun 13, 2025
## @metamask/chain-agnostic-permission ## [0.7.1] ### Changed - Bump `@metamask/keyring-internal-api` to `^6.2.0` ([#5871](#5871)) - Bump `@metamask/controller-utils` to `^11.10.0` ([#5935](#5935)) - Bump `@metamask/network-controller` to `^23.6.0` ([#5935](https://github.com/MetaMask/core/pull/5935),[#5882](https://github.com/MetaMask/core/pull/5882)) - Change `caip25CaveatBuilder` to list unsupported scopes in the unsupported scopes error ([#5806](#5806)) ### Fixed - Fix `isInternalAccountInPermittedAccountIds` and `isCaipAccountIdInPermittedAccountIds` to correctly handle comparison against `permittedAccounts` values of the `wallet:<namespace>:<address>` format ([#5980](#5980))
github-merge-queue bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…o helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1` ## **Related issues** [See slack thread where bug was initially reported](https://consensys.slack.com/archives/C08UFPWB3GB/p1749821334454809) ## **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/921b48a5-87d0-4900-ac60-f69219881d15 ### **After** https://github.com/user-attachments/assets/b3f06069-66aa-485d-b90d-997ed4544466 ## **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.
github-merge-queue bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…with fix to helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1` ## **Related issues** [See slack thread where bug was initially reported](https://consensys.slack.com/archives/C08UFPWB3GB/p1749821334454809) ## **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/921b48a5-87d0-4900-ac60-f69219881d15 ### **After** https://github.com/user-attachments/assets/b3f06069-66aa-485d-b90d-997ed4544466 ## **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.
runway-github bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…ion` with fix to helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1` ## **Related issues** [See slack thread where bug was initially reported](https://consensys.slack.com/archives/C08UFPWB3GB/p1749821334454809) ## **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/921b48a5-87d0-4900-ac60-f69219881d15 ### **After** https://github.com/user-attachments/assets/b3f06069-66aa-485d-b90d-997ed4544466 ## **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.
runway-github bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…ion` with fix to helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1` ## **Related issues** [See slack thread where bug was initially reported](https://consensys.slack.com/archives/C08UFPWB3GB/p1749821334454809) ## **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/921b48a5-87d0-4900-ac60-f69219881d15 ### **After** https://github.com/user-attachments/assets/b3f06069-66aa-485d-b90d-997ed4544466 ## **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.
runway-github bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…ion` with fix to helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1` ## **Related issues** [See slack thread where bug was initially reported](https://consensys.slack.com/archives/C08UFPWB3GB/p1749821334454809) ## **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/921b48a5-87d0-4900-ac60-f69219881d15 ### **After** https://github.com/user-attachments/assets/b3f06069-66aa-485d-b90d-997ed4544466 ## **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.
runway-github bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…ion` with fix to helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1` ## **Related issues** [See slack thread where bug was initially reported](https://consensys.slack.com/archives/C08UFPWB3GB/p1749821334454809) ## **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/921b48a5-87d0-4900-ac60-f69219881d15 ### **After** https://github.com/user-attachments/assets/b3f06069-66aa-485d-b90d-997ed4544466 ## **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.
adonesky1
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Jun 17, 2025
…th fix to helper function that was causing error thrown in certain cases when browser tabs were opened (#16383) [Core PR with fix to `isInternalAccountInPermittedAccountIds` & `isCaipAccountIdInPermittedAccountIds` ](MetaMask/core#5980) which was causing this bug. Bumps `@metamask/chain-agnostic-permission` to latest: `0.7.1`
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
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.
Explanation
We aren't handling the case where a permitted account with the
wallet:eip155scope prefix is passed intoisInternalAccountInPermittedAccountIds- where it is the only representation of its address in the permission set. In this case we wouldn't find a permitted account matching a passed in internal account and would ultimately throw an error resulting in the app crashing.References
Changelog
@metamask/chain-agnostic-permissionisInternalAccountInPermittedAccountIdsandisCaipAccountIdInPermittedAccountIdsto correctly handle comparison againstpermittedAccountsvalues of thewallet:<namespace>:<address>formatChecklist