fix: token rates controller start / stop logic#24021
Merged
Conversation
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. |
bergeron
commented
Apr 15, 2024
|
|
||
| if (useCurrencyRateCheck) { | ||
| this.currencyRateController.stopAllPolling(); | ||
| this.tokenRatesController.stop(); |
Contributor
Author
There was a problem hiding this comment.
This line is moved because I believe useCurrencyRateCheck is the proper guard, as occurs elsewhere. It was previously guarded by the autodetect feature, but pricing and autodetection are separate settings.
7 tasks
salimtb
approved these changes
Apr 15, 2024
sahar-fehri
approved these changes
Apr 16, 2024
jiexi
approved these changes
Apr 16, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #24021 +/- ##
===========================================
- Coverage 67.60% 67.59% -0.01%
===========================================
Files 1247 1247
Lines 48921 48925 +4
Branches 12772 12766 -6
===========================================
- Hits 33071 33067 -4
- Misses 15850 15858 +8 ☔ View full report in Codecov by Sentry. |
Collaborator
Builds ready [dd6bd5f]
Page Load Metrics (986 ± 575 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem: Users reporting missing fiat prices for some erc20 tokens, even when price setting is on:
Diagnosis:
(1) The
TokenRatesControllergets stopped when metamask is closed. But it is not started again when metamask re-opens, preventing any future token price updates.(2) If you have metamask installed but you never open/unlock it (within a browser session), the
TokenRatesControlleris still polling in the background every 3 minutes.The fix for both is to start the controller in
triggerNetworkrequestsinstead of on construction.Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist