Skip to content
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

fix: Fix migration 120.3 error caused by invalid state #26485

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 16, 2024

Description

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.

Open in GitHub Codespaces

Related issues

Fixes #26423

Manual testing steps

  • 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.

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.

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.

Fixes #26423
@Gudahtt Gudahtt marked this pull request as ready for review August 16, 2024 18:36
@Gudahtt Gudahtt requested a review from a team as a code owner August 16, 2024 18:36
Copy link

sonarcloud bot commented Aug 16, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [b47d2af]
Page Load Metrics (89 ± 14 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint742961174622
domContentLoaded49200843215
load56200893014
domInteractive118335157
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -15 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@Gudahtt Gudahtt added team-extension-platform needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Aug 19, 2024
@Gudahtt Gudahtt merged commit 6aba7d2 into develop Aug 19, 2024
82 checks passed
@Gudahtt Gudahtt deleted the fix-migration-120.3 branch August 19, 2024 14:11
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 19, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 19, 2024
@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.4.0 Issue or pull request that will be included in release 12.4.0 team-extension-platform team-wallet-framework
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Migration 120.3 error
5 participants