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: Add migration 120.4 to delete obsolete currency controller state #26383

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Aug 13, 2024

Description

We are seeing the following sorts of errors in production, as reported by sentry, in v12.0.2:
No metadata found for 'conversionDate'
No metadata found for 'usdConversionRate'
No metadata found for 'nativeCurrency'
No metadata found for 'conversionRate'

Example issue: https://metamask.sentry.io/issues/5682684113/events/b8006eebb65749f883e907242e52215b/?project=273505&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D+No+metadata+release%3A12.0.1&referrer=previous-event&statsPeriod=14d&stream_index=1

The CurrencyRateController stopped using six such properties with MetaMask/core#1805, which was brought into the extension with #21549, however, there was not a state migration to delete those properties at the time

This PR adds migrations to delete those obsolete properties

Open in GitHub Codespaces

Related issues

Fixes: #26356

Manual testing steps

To observe the error using steps that mimic users in production

  1. Install v11.6.0 and onboard
  2. Create a local dev build from the master branch
  3. Update the v11.6.0 install to the local dev build
  4. See the errors in the service worker console

If you repeat those steps, but in step two build from this branch instead of the master branch, the errors will not occur

For a faster manual test of this PR, create a local development build of this branch and then run this script in the service worker console:

window.chrome.storage.local.get(({ data, meta }) => chrome.storage.local.set({ data: { ...data, CurrencyController: { ...data.CurrencyController, conversionDate: 'Jan 1', conversionRate: '2', nativeCurrency: 'test' } }, meta: {...meta, version: 120 } }, () => { chrome.runtime.reload() }))

There should be no errors like No metadata found for 'conversionRate' (but if you do the same on develop or master, those errors should be present)

Screenshots/Recordings

Before

After

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.

@danjm danjm requested a review from a team as a code owner August 13, 2024 09:58
Copy link
Contributor

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.

@danjm danjm changed the title Add migration 120.4 to delete obsolete currency controller state fix: Add migration 120.4 to delete obsolete currency controller state Aug 13, 2024
Copy link

sonarcloud bot commented Aug 13, 2024

Copy link
Member

@Gudahtt Gudahtt 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 ac638f1 into develop Aug 13, 2024
76 of 78 checks passed
@danjm danjm deleted the delete-currencycontroller-state branch August 13, 2024 13:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Aug 13, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [03f30c3]
Page Load Metrics (418 ± 345 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7770412913364
domContentLoaded9109252210
load442308418719345
domInteractive9109252210
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.27 KiB (0.04%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.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.3.0 Issue or pull request that will be included in release 12.3.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: No metadata found for 'conversionRate'
5 participants