-
Notifications
You must be signed in to change notification settings - Fork 5.5k
chore(migrations): remove nulls from root state #39471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [1f3d4b2]
UI Startup Metrics (1330 ± 107 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces migration 190 to clean up null seedPhrase values from the MetaMask extension state. This addresses a state inconsistency issue where seedPhrase was being set to null instead of being properly removed.
Changes:
- Added migration 190 to delete seedPhrase property when its value is null
- Updated migration index to include the new migration
- Updated E2E test snapshot to reflect the new version number
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/scripts/migrations/190.ts | Implements migration logic to remove null seedPhrase from state and track the change |
| app/scripts/migrations/190.test.ts | Adds tests for null and non-null seedPhrase scenarios |
| app/scripts/migrations/index.js | Registers migration 190 in the migrations array |
| test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json | Updates version metadata to 190 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Builds ready [b05d079]
UI Startup Metrics (1281 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
seedWords from state
b05d079 to
4a48857
Compare
4a48857 to
e62504f
Compare
<!-- 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** Follow up to the workaround in 3345f3e [](https://codespaces.new/MetaMask/metamask-extension/pull/39471?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: null ## **Related issues** Related to: #39464 <!-- ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **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/main/.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/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] > Adds a targeted cleanup migration and aligns tests/snapshots. > > - Introduces `migrations/190` that sets version to `190` and removes `null` `seedWords` and `forgottenPassword` from `data`, recording changed keys > - Registers the migration in `migrations/index.js` > - Adds comprehensive unit tests `migrations/190.test.ts` covering presence/absence and null/non-null cases > - Updates e2e state snapshot meta version from `189` to `190` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5a2e246. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Builds ready [1def246]
UI Startup Metrics (1341 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
0247ea9
Builds ready [e9e6c36]
UI Startup Metrics (1339 ± 110 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [5c991fe]
UI Startup Metrics (1368 ± 114 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/extension-platform (1 files, +2 -2)
🧪 @MetaMask/qa (1 files, +2 -2)
|
Builds ready [7571098]
UI Startup Metrics (1345 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Description
Follow up to the workaround in 3345f3e
Changelog
CHANGELOG entry: null
Related issues
Related to: #39464
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: adds a small, narrowly-scoped state migration that only deletes root keys when their value is explicitly
null, plus fixture/version updates and tests.Overview
Adds new migration
191that removes root-levelseedWordsandforgottenPasswordfields when their persisted value isnull, recording those keys inchangedKeys.Registers the migration in
app/scripts/migrations/index.js, adds unit tests covering presence/absence and null/non-null cases, and bumps e2e fixture/state-snapshotmeta.version/currentMigrationVersionfrom190to191.Written by Cursor Bugbot for commit 7571098. This will update automatically on new commits. Configure here.