-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix: update migration 105.ts to keep internal account scopes #36505
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. |
// omit the new field to re-use the original type for that migration. | ||
export type InternalAccountV1 = Omit<InternalAccount, 'scopes'>; |
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.
This is interesting. From the sounds of it, it seems like the original type when this migration was made did not have the scopes property.
But it doesn't look like any of our other migrations adds back this property (meaning older users who migrate / our e2e tests) never receive a scopes property?
}, | ||
methods: ETH_EOA_METHODS, | ||
type: EthAccountType.Eoa, | ||
scopes: [EthScope.Eoa], |
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.
Rather than omitting the Scopes property, we are defaulting to the Eth EOA scope (similar to the Eth EOA type).
const matchesAccount = Object.values(internalAccounts.accounts).some( | ||
(account) => { | ||
const matchesScope = account.scopes?.some((scope) => { | ||
const matchesScope = account.scopes.some((scope) => { |
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.
Removing this hotfix from my OG PR (was done to ensure CI was green)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [fae2ef2]
UI Startup Metrics (1238 ± 80 ms)
Benchmark value 253 exceeds gate value 10 for chrome browserify home mean backgroundConnect Benchmark value 28 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 16 exceeds gate value 15 for chrome browserify home mean getState Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 268 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 35 exceeds gate value 33 for chrome browserify home p95 getState Benchmark value 14 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 20 exceeds gate value 17 for chrome browserify home p95 setupStore Benchmark value 2403 exceeds gate value 2192 for chrome webpack home mean uiStartup Benchmark value 1927 exceeds gate value 1711 for chrome webpack home mean load Benchmark value 1908 exceeds gate value 1704 for chrome webpack home mean domContentLoaded Benchmark value 23 exceeds gate value 21 for chrome webpack home mean domInteractive Benchmark value 57 exceeds gate value 40 for chrome webpack home mean backgroundConnect Benchmark value 1903 exceeds gate value 1699 for chrome webpack home mean loadScripts Benchmark value 2897 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 2363 exceeds gate value 2030 for chrome webpack home p95 load Benchmark value 2349 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded Benchmark value 85 exceeds gate value 57 for chrome webpack home p95 domInteractive Benchmark value 335 exceeds gate value 334 for chrome webpack home p95 firstPaint Benchmark value 334 exceeds gate value 90 for chrome webpack home p95 backgroundConnect Benchmark value 198 exceeds gate value 195 for chrome webpack home p95 getState Benchmark value 13 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 2336 exceeds gate value 1970 for chrome webpack home p95 loadScripts Benchmark value 201 exceeds gate value 65 for chrome webpack home p95 setupStore Benchmark value 1423 exceeds gate value 1405 for firefox browserify home mean uiStartup Benchmark value 33 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 29 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 251 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 6 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 107 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 33 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 4 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 303 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 10 exceeds gate value 2 for firefox webpack home p95 initialActions Sum of mean exceeds: 1165ms | Sum of p95 exceeds: 2386.8ms Sum of all benchmark exceeds: 3551.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Uncovered when running E2E tests. It seems that this 105.ts migration ended up removing/not adding the
scopes
property on our internal accounts.This ensures we add back the scopes property.
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
https://www.loom.com/share/0ed66cf144c140fc84868d95e3500bb8?sid=20a77514-b5b6-40fe-9e3b-7a245955914d
Pre-merge author checklist
Pre-merge reviewer checklist