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

Add networkClientId to DetectTokensController.detectNewTokens() #22898

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Feb 9, 2024

Description

Currently networkClientId token based polling in the DetectTokensController does not make the getBalancesInSingleCall contract call with the provider for the networkClientId. This is because networkClientId is not being passed from _executePoll to getBalancesInSingleCall.

This PR adds an optional networkClientId param to detectNewTokens which is used to:

  • make getBalancesInSingleCall calls with the correct provider
  • override the chainId argument if also passed

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2097

Manual testing steps

Nothing should change as this does not affect the current single globally selected network flow and the multichain polling for this has not been integrated yet.

Screenshots/Recordings

Before

After

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.

@jiexi jiexi requested a review from a team as a code owner February 9, 2024 22:48
Copy link
Contributor

github-actions bot commented Feb 9, 2024

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.

adonesky1
adonesky1 previously approved these changes Feb 10, 2024
Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM!

bergeron
bergeron previously approved these changes Feb 13, 2024
@jiexi jiexi dismissed stale reviews from bergeron and adonesky1 via 2cd0d7a February 13, 2024 19:43
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

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

Comparison is base (34df597) 68.54% compared to head (2cd0d7a) 68.54%.

Files Patch % Lines
app/scripts/controllers/detect-tokens.js 62.50% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22898      +/-   ##
===========================================
- Coverage    68.54%   68.54%   -0.00%     
===========================================
  Files         1088     1088              
  Lines        42900    42904       +4     
  Branches     11418    11419       +1     
===========================================
+ Hits         29403    29405       +2     
- Misses       13497    13499       +2     

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

@metamaskbot
Copy link
Collaborator

Builds ready [2cd0d7a]
Page Load Metrics (989 ± 48 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1603482084019
domContentLoaded1469492110
load88112789899948
domInteractive1469492110
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 47 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM

@adonesky1 adonesky1 merged commit 85cd1c8 into develop Feb 14, 2024
65 checks passed
@adonesky1 adonesky1 deleted the jl/mmp-2097/fix-detect-tokens-detectNewTokens branch February 14, 2024 20:57
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
@metamaskbot metamaskbot added the release-11.12.0 Issue or pull request that will be included in release 11.12.0 label Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.12.0 Issue or pull request that will be included in release 11.12.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants