fix: Fix invalid state causing migration 88 to fail#26397
Conversation
We have found evidence that migration 88 is failing for some users due to a `null` key in the `TokensController.allTokens` state. The migration has been updated to delete any invalid `null`-keys prior to migrating it, preventing the error. Fixes #25938
There was a problem hiding this comment.
Strongly recommend using "Hide whitespace" to view this diff, it's only 38 lines with that enabled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26397 +/- ##
===========================================
+ Coverage 70.13% 70.14% +0.01%
===========================================
Files 1435 1435
Lines 50309 50327 +18
Branches 13897 13915 +18
===========================================
+ Hits 35283 35301 +18
Misses 15026 15026 ☔ View full report in Codecov by Sentry. |
Builds ready [47a2415]
Page Load Metrics (66 ± 7 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| if (chainId === 'undefined' || chainId === undefined) { | ||
| if ( | ||
| chainId === 'undefined' || | ||
| chainId === undefined || |
There was a problem hiding this comment.
Pretty sure Object.keys would always return undefined as a string literal, do we shouldn't need this condition. But it was already there, so I left it to minimize changes.
I confirmed that using null here didn't work, I needed to check for the string 'null'.



Description
We have found evidence that migration 88 is failing for some users due to a
nullkey in theTokensController.allTokensstate. The migration has been updated to delete any invalidnull-keys prior to migrating it, preventing the error.Related issues
Fixes #25938
Manual testing steps
The unit tests demonstrate the affected scenario fairly well. We addressed the "null key" case for a variety of different parts of state, but specifically the one we are seeing in prod is the
allTokensstate having anullkey.Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist