Skip to content

fix case where internal accounts can be undefined#6000

Merged
adonesky1 merged 5 commits intomainfrom
ad/mme-32451
Jun 18, 2025
Merged

fix case where internal accounts can be undefined#6000
adonesky1 merged 5 commits intomainfrom
ad/mme-32451

Conversation

@adonesky1
Copy link
Copy Markdown
Contributor

Explanation

Temporary fix for the issue where the internal account has no scopes and or scopes is undefined
there is currently a bug where an account associated with a snap can fail to add scopes to the internal account in time
before we attempt to access this state

References

For example:

Changelog

@metamask/chain-agnostic-permission

CHANGED: isInternalAccountInPermittedAccountIds now returns false when passed an InternalAccount where scopes is undefined

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

@adonesky1 adonesky1 requested a review from a team as a code owner June 18, 2025 15:23
jiexi
jiexi previously approved these changes Jun 18, 2025
jiexi
jiexi previously approved these changes Jun 18, 2025
jiexi
jiexi previously approved these changes Jun 18, 2025
ffmcgee725
ffmcgee725 previously approved these changes Jun 18, 2025
jiexi
jiexi previously approved these changes Jun 18, 2025
@ffmcgee725 ffmcgee725 dismissed stale reviews from jiexi and themself via 3a0544a June 18, 2025 15:49
@adonesky1 adonesky1 enabled auto-merge (squash) June 18, 2025 15:53
@adonesky1 adonesky1 merged commit 0daa634 into main Jun 18, 2025
214 checks passed
@adonesky1 adonesky1 deleted the ad/mme-32451 branch June 18, 2025 16:04
@adonesky1 adonesky1 mentioned this pull request Jun 18, 2025
ffmcgee725 pushed a commit that referenced this pull request Jun 19, 2025
## @metamask/chain-agnostic-permission

## [0.8.0]

### Changed

- `isInternalAccountInPermittedAccountIds` now returns `false` when
passed an `InternalAccount` in which `scopes` is `undefined`
([#6000](#6000))
- Bump `@metamask/network-controller` to `^24.0.0`
([#5999](#5999))
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.

[Sentry] TypeError: Cannot read properties of undefined (reading 'map')

3 participants