Skip to content

fix: Fix invalid state causing migration 88 to fail (#26397)#26401

Merged
danjm merged 1 commit intoVersion-v12.0.2from
cherry-pick/fix-migration-88-invalid-state
Aug 13, 2024
Merged

fix: Fix invalid state causing migration 88 to fail (#26397)#26401
danjm merged 1 commit intoVersion-v12.0.2from
cherry-pick/fix-migration-88-invalid-state

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Aug 13, 2024

This is a cherry-pick of #26397. Original description:

Description

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.

Open in GitHub Codespaces

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 allTokens state having a null key.

Screenshots/Recordings

N/A

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.

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

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.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26397?quickstart=1)

## **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 `allTokens` state
having a `null` key.

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.70%. Comparing base (84b0007) to head (434bd9c).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           Version-v12.0.2   #26401      +/-   ##
===================================================
+ Coverage            65.69%   65.70%   +0.01%     
===================================================
  Files                 1370     1370              
  Lines                54705    54723      +18     
  Branches             14235    14253      +18     
===================================================
+ Hits                 35935    35953      +18     
  Misses               18770    18770              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gudahtt Gudahtt marked this pull request as ready for review August 13, 2024 21:24
@Gudahtt Gudahtt requested a review from a team as a code owner August 13, 2024 21:24
Copy link
Copy Markdown
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@danjm danjm merged commit ecfd64d into Version-v12.0.2 Aug 13, 2024
@danjm danjm deleted the cherry-pick/fix-migration-88-invalid-state branch August 13, 2024 21:28
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [434bd9c]
Page Load Metrics (49 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66997984
domContentLoaded8181121
load42734984
domInteractive8181121

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants