Skip to content

fix: fix tokenRatesController#22295

Merged
sahar-fehri merged 1 commit intodevelopfrom
fix/fix-metamask-controller
Dec 15, 2023
Merged

fix: fix tokenRatesController#22295
sahar-fehri merged 1 commit intodevelopfrom
fix/fix-metamask-controller

Conversation

@sahar-fehri
Copy link
Copy Markdown
Contributor

@sahar-fehri sahar-fehri commented Dec 14, 2023

Description

When Using latest version of core, the UI cannot display on the home page the user's fiat token balance.
This PR fixes the instantiation of the tokenRatesController.

This was tested by building core with assets-controllers version 21.0.0.

Related issues

Fixes:

Manual testing steps

  1. Build core
  2. build extension
  3. go to home page
  4. Click import token button
  5. Choose any token and import
  6. You should see on the home page the token balance even if $0.00

Screenshots/Recordings

Before

With the current versions you would have errors loading the extension
image

After

Loads successfully and home page displays token fiat balance
image

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@sahar-fehri sahar-fehri self-assigned this Dec 14, 2023
@sahar-fehri sahar-fehri requested a review from a team as a code owner December 14, 2023 22:13
@github-actions
Copy link
Copy Markdown
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.

@socket-security
Copy link
Copy Markdown

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/assets-controllers 20.0.0...21.0.0 shell +3/-0 1.65 MB metamaskbot

@socket-security
Copy link
Copy Markdown

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Shell access cockatiel 3.1.1

Next steps

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore cockatiel@3.1.1

@jiexi
Copy link
Copy Markdown
Member

jiexi commented Dec 15, 2023

#22152 should have included this change. Thank you for fixing this

EDIT: Actually the networkDidChange update was part of assets-controller 21.0.0, so i'm unsure how this was broken before that

EDIT2: I think I understand now. I believe your PR title should be something like Bump @metamask/assets-controller to 21.0.0

Copy link
Copy Markdown
Member

@jiexi jiexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GasFeeController also takes in onNetworkDidChange now

@jiexi jiexi added the team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead label Dec 15, 2023
@sahar-fehri sahar-fehri force-pushed the fix/fix-metamask-controller branch from 816db90 to a0d2c12 Compare December 15, 2023 15:09
@bergeron
Copy link
Copy Markdown
Contributor

@metamaskbot update-policies

@metamaskbot
Copy link
Copy Markdown
Collaborator

Policies updated

@sahar-fehri sahar-fehri requested review from a team as code owners December 15, 2023 18:38
Copy link
Copy Markdown
Member

@jiexi jiexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Just minor comments on removing some stale comments. Thank you!

@sahar-fehri sahar-fehri force-pushed the fix/fix-metamask-controller branch 2 times, most recently from 9cd04fc to 7fdf394 Compare December 15, 2023 19:19
@jiexi
Copy link
Copy Markdown
Member

jiexi commented Dec 15, 2023

REMINDER: Please update the squashed commit message to mention the bump of @metamask/assets-controller to 21.0.0

@sahar-fehri sahar-fehri force-pushed the fix/fix-metamask-controller branch from 7fdf394 to 1f539d2 Compare December 15, 2023 19:43
@sahar-fehri sahar-fehri force-pushed the fix/fix-metamask-controller branch from 1f539d2 to 00abdec Compare December 15, 2023 19:48
Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you for taking care of this.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (9e1a96b) 67.96% compared to head (00abdec) 67.94%.

Files Patch % Lines
app/scripts/metamask-controller.js 93.75% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22295      +/-   ##
===========================================
- Coverage    67.96%   67.94%   -0.02%     
===========================================
  Files         1067     1067              
  Lines        41274    41290      +16     
  Branches     11082    11087       +5     
===========================================
+ Hits         28050    28054       +4     
- Misses       13224    13236      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sahar-fehri sahar-fehri merged commit 3f113bd into develop Dec 15, 2023
@sahar-fehri sahar-fehri deleted the fix/fix-metamask-controller branch December 15, 2023 20:27
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2023
@metamaskbot metamaskbot added the release-11.9.0 Issue or pull request that will be included in release 11.9.0 label Dec 15, 2023
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [00abdec]
Page Load Metrics (1219 ± 130 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint823121797034
domContentLoaded10182697033
load77717351219272130
domInteractive10182697033
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 462 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 47.09 KiB (0.93%)

@metamaskbot metamaskbot added release-11.7.3 Issue or pull request that will be included in release 11.7.3 and removed release-11.9.0 Issue or pull request that will be included in release 11.9.0 labels Jan 2, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-11.7.3 on PR. Adding release label release-11.7.3 on PR and removing other release labels(release-11.9.0), as PR was cherry-picked in branch 11.7.3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.7.3 Issue or pull request that will be included in release 11.7.3 team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants