metamask-extension
metamask-extension copied to clipboard
fix: reduce size of token list fetch
Description
When switching to a network for the first time, MM checks whether a token list is available for the network. If not, the 3rd item is shown here:
But we don't need the entire token list, since we're only checking whether a list is available. Adding query parameters to reduce the response size. On mainnet for example, 1.5MB (gzipped) to < 1KB.
Related issues
Manual testing steps
- Open metamask
- Visit a chain that has token lists, like linea
- The popup should not warn about missing tokens
- Visit a chain that does not have token lists, like filecoin
- The popup should warn about missing tokens
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [ ] I’ve followed MetaMask Coding Standards.
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using JSDoc format if applicable
- [ ] I’ve applied the right labels on the PR (see labeling guidelines). 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.
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.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 67.34%. Comparing base (
44e29aa
) to head (acc46e3
).
Additional details and impacted files
@@ Coverage Diff @@
## develop #24316 +/- ##
========================================
Coverage 67.34% 67.34%
========================================
Files 1282 1282
Lines 50065 50065
Branches 12986 12986
========================================
Hits 33716 33716
Misses 16349 16349
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hmmm the e2e tests failing in CI are passing locally
I'm confused by the e2e test failures. They keep passing locally in both browsers, and should be unrelated to the changes.
-
Success on testcase: 'Wallet Created Events @no-mmi are not sent when onboarding user who chooses to opt out metrics'
-
Success on testcase: 'Connections page should disconnect when click on Disconnect button in connections page'
-
Success on testcase: 'Permissions Page should redirect users to connections page when users click on connected permission'
- ...etc
But not in CI for some reason?
Builds ready [da392d5]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1229 ± 614 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 71 | 177 | 103 | 29 | 14 |
domContentLoaded | 10 | 60 | 21 | 15 | 7 | ||
load | 58 | 2910 | 1229 | 1278 | 614 | ||
domInteractive | 10 | 60 | 21 | 15 | 7 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 46 Bytes (0.00%)
- common: 0 Bytes (0.00%)