-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
TokenRatesController: Use browser compat eq check #3663
Merged
Merged
Conversation
This file contains 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
`isDeepStrictEqual` is a function from Node's `util` module. However, it doesn't exist in a browser context, so using it crashes the extension. This commit replaces this function with `fast-equals`' [`strictDeepEqual`][1] function, which essentially does the same thing as [`isDeepStrictEqual`][2] in a more robust way. [1]: https://github.com/planttheidea/fast-equals/blob/7564fcf46a187d011261d4a6d60724cb2ec3a75d/src/equals.ts [2]: https://github.com/sindresorhus/core-assert/blob/fa0ab246046a81deb4cac841fee8b89b4cb3b296/index.js#L165
mcmire
force-pushed
the
fix-equality-check-in-token-rates-controller
branch
from
December 13, 2023 21:17
3d633a2
to
8033f29
Compare
mcmire
commented
Dec 13, 2023
@@ -27,6 +27,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
- **BREAKING:** Remove `CoinGeckoResponse` and `CoinGeckoPlatform` types ([#3600](https://github.com/MetaMask/core/pull/3600)) | |||
- These types were previously used in TokenRatesController to represent data returned from the CoinGecko API. There is no equivalent. | |||
|
|||
### Fixed | |||
- Fix TokenRatesController to prevent redundant token rate updates when tokens change ([#3647](https://github.com/MetaMask/core/pull/3647), [#3663](https://github.com/MetaMask/core/pull/3663)) |
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 copied from the changelog notes for #3647; I also added this PR, since it's a fix for that change.
Gudahtt
reviewed
Dec 13, 2023
Gudahtt
approved these changes
Dec 14, 2023
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.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
isDeepStrictEqual
is a function from Node'sutil
module. However, it doesn't exist in a browser context, so using it crashes the extension.This commit replaces this function with
fast-equals
'strictDeepEqual
function, which essentially does the same thing asisDeepStrictEqual
in a more robust way.Changelog
(Updated in PR)
Checklist