Skip to content

Conversation

@juanmigdr
Copy link
Member

@juanmigdr juanmigdr commented Nov 10, 2025

Description

Fix sentry error saying alIgnoredTokens is undefined. I could not repro but believe this is the fix

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fix cannot read properties of undefined (allIgnoredTokens)

Related issues

Fixes: #37659 & https://consensyssoftware.atlassian.net/browse/ASSETS-1767

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Note

Defaults getAllIgnoredAssets to EMPTY_OBJECT to prevent undefined access errors.

Written by Cursor Bugbot for commit 0230527. This will update automatically on new commits. Configure here.

@juanmigdr juanmigdr changed the title chore: cannot read properties of undefined (allIgnoredTokens) fix: cannot read properties of undefined (allIgnoredTokens) Nov 10, 2025
@juanmigdr juanmigdr marked this pull request as ready for review November 10, 2025 12:49
*/
export function getAllIgnoredAssets(state: AssetsState) {
return state.metamask.allIgnoredAssets;
return state.metamask.allIgnoredAssets ?? EMPTY_OBJECT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok with this as it solves the issue for now, but we either need to:

  • Ensure that a newly created instance of the controller holding this state creates allIgnoredAssets if it's not present.
  • Create a migration so that state is created as well (I don't like this one as I believe that controller is behind code fencing)

Copy link
Member Author

Choose a reason for hiding this comment

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

I have tested updating from 13.7.0 to 13.8.0 and I do see the field being created thats why I cannot really repro. I have fixed it this way due to seeing this kind of implementation here:
image

@juanmigdr juanmigdr changed the title fix: cannot read properties of undefined (allIgnoredTokens) fix: cp-13.9.0 cannot read properties of undefined (allIgnoredTokens) Nov 10, 2025
@juanmigdr juanmigdr enabled auto-merge November 10, 2025 13:00
@metamaskbot
Copy link
Collaborator

Builds ready [0230527]
UI Startup Metrics (1237 ± 89 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1237109414908912701451
load106592213018111061242
domContentLoaded105991712977910961231
domInteractive221487151859
firstPaint64687128142810671227
backgroundConnect2352202608240251
firstReactRender28195783047
getState22966112547
initialActions001001
loadScripts830702106778865997
setupStore1172531215
numNetworkReqs1367620674
BrowserifyPower User HomeuiStartup19261736277129622182771
load1040898161222413091612
domContentLoaded1029886160522112881605
domInteractive311578236178
firstPaint788172161047213221610
backgroundConnect23922126513251265
firstReactRender28254352743
getState17015320517188205
initialActions001011
loadScripts803659134621510651346
setupStore1293371133
numNetworkReqs1207425374241253
WebpackStandard HomeuiStartup83969712201018601116
load61255397883606865
domContentLoaded60454794978599843
domInteractive16125181438
firstPaint19661952194188686
backgroundConnect261193162864
firstReactRender3018108113440
getState1162741318
initialActions003001
loadScripts60254593976597832
setupStore1252941321
numNetworkReqs1367519872
WebpackPower User HomeuiStartup13321254179014213181790
load675604914101759914
domContentLoaded65759384388717843
domInteractive271387234787
firstPaint37165842272620842
backgroundConnect55112876470287
firstReactRender28263112931
getState14510917319157173
initialActions001011
loadScripts65259183185706831
setupStore97152915
numNetworkReqs1057018041164180
FirefoxBrowserifyStandard HomeuiStartup14691288188412715351720
load1244111514868812941417
domContentLoaded1244111514868812941417
domInteractive1053428243111201
firstPaint------
backgroundConnect4124131184871
firstReactRender25214642635
getState9417818717
initialActions001001
loadScripts1220109714548412681385
setupStore1274761327
numNetworkReqs1266215857
BrowserifyPower User HomeuiStartup24202036363643624873636
load13321104195124715401951
domContentLoaded13321104195024715401950
domInteractive19460641192397641
firstPaint------
backgroundConnect1063141397134413
firstReactRender452788175088
getState1288032255132322
initialActions105115
loadScripts13021082188323815161883
setupStore2761113041111
numNetworkReqs1567231887224318
WebpackStandard HomeuiStartup16681483242419116812230
load14091224190711514711650
domContentLoaded14091224190711514711650
domInteractive943726331100163
firstPaint------
backgroundConnect58262213860142
firstReactRender312280103349
getState14420129760
initialActions002001
loadScripts13751206176110514401616
setupStore2071652617112
numNetworkReqs1367018767
WebpackPower User HomeuiStartup25512230327127627173271
load15211238188717817021887
domContentLoaded15211238188617817021886
domInteractive15738407121311407
firstPaint------
backgroundConnect963428672147286
firstReactRender473176135376
getState1307124749180247
initialActions101111
loadScripts14861209179916716591799
setupStore19669193369
numNetworkReqs1316528076209280
📊 Page Load Benchmark Results

Current Commit: 0230527 | Date: 11/10/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±111ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±136ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±120ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 111ms 1.01s 2.11s 1.06s 2.11s
domContentLoaded 729ms 136ms 698ms 2.06s 740ms 2.06s
firstPaint 87ms 120ms 60ms 1.28s 88ms 1.28s
firstContentfulPaint 87ms 120ms 60ms 1.28s 88ms 1.28s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -7 Bytes (0%)
  • ui: -52 Bytes (0%)
  • common: 70 Bytes (0%)

@juanmigdr juanmigdr added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit 7b04707 Nov 10, 2025
187 of 194 checks passed
@juanmigdr juanmigdr deleted the fix/undefined-allIgnoredTokens branch November 10, 2025 13:43
runway-github bot added a commit that referenced this pull request Nov 10, 2025
…kens) (#37660)

<!--
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**
Fix sentry error saying alIgnoredTokens is undefined. I could not repro
but believe this is the fix
<!--
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/37660?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: fix cannot read properties of undefined
(allIgnoredTokens)

## **Related issues**

Fixes: #37659

## **Manual testing steps**

1. Go to this page...
2.
3.

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

- [ ] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Defaults `getAllIgnoredAssets` to `EMPTY_OBJECT` to prevent undefined
access errors.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0230527. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
runway-github bot added a commit that referenced this pull request Nov 10, 2025
…kens) (#37660)

<!--
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**
Fix sentry error saying alIgnoredTokens is undefined. I could not repro
but believe this is the fix
<!--
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/37660?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: fix cannot read properties of undefined
(allIgnoredTokens)

## **Related issues**

Fixes: #37659

## **Manual testing steps**

1. Go to this page...
2.
3.

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

- [ ] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Defaults `getAllIgnoredAssets` to `EMPTY_OBJECT` to prevent undefined
access errors.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0230527. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
@metamaskbot metamaskbot added the release-13.10.0 Issue or pull request that will be included in release 13.10.0 label Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.10.0 Issue or pull request that will be included in release 13.10.0 size-XS team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sentry] TypeError: Cannot read properties of undefined (reading 'a3711955-392d-410c-b4d6-aa064b9f3fb3')

5 participants