cherry-pick: Fix migration 120.3 error caused by invalid state (#26485)#26517
Merged
Gudahtt merged 1 commit intoVersion-v12.0.6from Aug 21, 2024
Merged
cherry-pick: Fix migration 120.3 error caused by invalid state (#26485)#26517Gudahtt merged 1 commit intoVersion-v12.0.6from
Gudahtt merged 1 commit intoVersion-v12.0.6from
Conversation
For a small number of users, migration 120.3 is failing due to invalid `TransactionController.transactions` state. We aren't sure yet how this is happening, but we can resolve the problem by updating the migration to delete this invalid state if we detect it. No other state relies on this state, and if it's invalid it won't work properly anyway. The migration has been renamed from 120.3 to 120.6 so that it will be re-run for any users who encountered this migration on v12.0.1 already. [](https://codespaces.new/MetaMask/metamask-extension/pull/26485?quickstart=1) Fixes #26423 * Create a dev build from v12.0.0 * Install the dev build from the `dist/chrome` directory and proceed through onboarding * Run this command in the background console: ``` chrome.storage.local.get( null, (state) => { state.data.TransactionController.transactions = {}; chrome.storage.local.set(state, () => chrome.runtime.reload()); } ); ``` * Disable the extension * Switch to v12.0.1 and create a dev build * Enable and reload the extension * You should see in the console that migration 120.3 has failed * Disable the extension * Switch to this branch and create a dev build * Enable and reload the extension * You should see in the console that migration 120.6 has run without error * You can run `chrome.storage.local.get(console.log)` to check that the transactions state has been removed. N/A - [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. - [ ] 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## Version-v12.0.6 #26517 +/- ##
================================================
Coverage 65.75% 65.75%
================================================
Files 1372 1372
Lines 54766 54767 +1
Branches 14260 14260
================================================
+ Hits 36006 36007 +1
Misses 18760 18760 ☔ View full report in Codecov by Sentry. |
Collaborator
Builds ready [3350494]
Page Load Metrics (67 ± 9 ms)
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This cherry-picks #26485 into v12.0.6. Original description:
Description
For a small number of users, migration 120.3 is failing due to invalid
TransactionController.transactionsstate. We aren't sure yet how this is happening, but we can resolve the problem by updating the migration to delete this invalid state if we detect it. No other state relies on this state, and if it's invalid it won't work properly anyway.The migration has been renamed from 120.3 to 120.6 so that it will be re-run for any users who encountered this migration on v12.0.1 already.
Related issues
Fixes #26423
Manual testing steps
dist/chromedirectory and proceed through onboardingchrome.storage.local.get( null, (state) => { state.data.TransactionController.transactions = {}; chrome.storage.local.set(state, () => chrome.runtime.reload()); } );chrome.storage.local.get(console.log)to check that the transactions state has been removed.Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist