Merged
Conversation
* Update transaction params validation * fixup! Update transaction params validation * Update to/data error message * fixup! Update to/data error message
The `waitUntilCalled` utility now has a timeout. It will now throw an error if the stub is not called enough times, rather than blocking forever. The return type had to be changed to a function, so that we could throw when the timeout is triggered. I tried returning an error that rejected first, but if you don't handle the error synchronously Node.js will consider it to be an unhandled Promise rejected (even if it _is_ handled later on). I worked around this by resolving in the timeout case as well, so that there is never a "deferred" Promise exception in the timeout case. The returned function re-throws the error if it's given. That way there is never any unhandled Promise rejection.
Sync `master` with `develop`
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 10.4.0 to 10.4.1. - [Release notes](https://github.com/highlightjs/highlight.js/releases) - [Changelog](https://github.com/highlightjs/highlight.js/blob/master/CHANGES.md) - [Commits](highlightjs/highlight.js@10.4.0...10.4.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…back to build quote screen while having insufficient funds (#9994)
* Remove web3 injection * Implement logWeb3ShimUsage
When the SES lockdown was added in #9729, the lockdown and the Sentry initialization were migrated from the main bundle into separate modules, which were run as separate `<script>` tags. These extra tags were accidentally omitted for `home.html` and `notification.html`. As a result Sentry was not initialized on these pages, so any errors thrown on them would not be collected. They also do not benefit from the SES lockdown. The SES lockdown and Sentry initialization modules have been added to both pages where they were missing.
The SES lockdown added in #9729 had the effect of obfuscating our error messages. Any messages printed to the console would have the error message replaced with the string "Error #" followed by a number. The stack was also updated to point at `lockdown.cjs`, though the original stack was preserved beneath the top stack frame. Marking the `console` API as untamed seems to have fixed both issues. The original error message is now printed to the console, along with the original stack.
The new metrics controller has a `trackEvent` function that was being called unbound, so `this` references were undefined. It is now bound early in both places where it is passed in as a parameter.
On older browsers that don't support `globalThis`[1], the SES lockdown throws an error. The `globalthis` shim has been added to all pages, to the background process, and to the `contentscript`. This should prevent the error on older browsers. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#Browser_compatibility
Failures to persist state are now logged in Sentry. Previously they were only logged to the background console.
* @metamask/inpage-provider@^8.0.0 * Replace public config store with JSON-RPC notifications * Encapsulate notification permissioning in permissions controller * Update prefix of certain internal RPC methods and notifications * Add accounts to getProviderState * Send accounts with isUnlocked notification (#10007) * Rename provider streams, notify provider of stream failures (#10006)
From a behavioral standpoint this PR fixes the issue with tracking, and persisting, tokens that the user hides. Whether we can/should optimize this to prevent duplicates of the accountHiddenTokens and hiddenToken is a point of contention, but it acts similiarly to how we track tokens and accountTokens. Also to note, for tokens under a custom network there is no way to distinguish two different custom network sets of hidden tokens, they are all under the `rpc` property, same as accountTokens.
This reverts commit 7696de2.
This reverts commit d783966.
* origin/develop: Add hidden tokens to store (#9320) @metamask/inpage-provider@^8.0.0 (#8640) Log persistence errors with Sentry (#10018) Fix SES lockdown on older browsers (#10014) Reapply view quote screen designs (#9905) Fix unbound metrics track function (#10016) Deobfuscate error message (#10012) Add SES lockdown and Sentry to all pages (#10013) Remove web3 injection (#9156) Initialize network controller provider chainId to the appropriate default networks (#9999) Fix Infura network chain IDs (#8629) Prevent props error in swaps gas modal (#10001) Fix 9906 - Prevent unwanted 'no quotes available' message when going back to build quote screen while having insufficient funds (#9994) Fix 9988 - Don't allow more than 15% slippage (#9991) Bump highlight.js from 10.4.0 to 10.4.1 (#10004) Add timeout to `wait-until-called` (#9996) Update transaction params validation (#9992)
Sync `master` with `develop`
When you load an extension `.zip` file in Firefox, it fails to load scripts with the `.cjs` file extension. However, it works if you load the extension via the `manifest.json` file instead. After renaming the `lockdown.cjs` file to `lockdown.js`, it works in Firefox in all cases, regardless whether it's loaded by manifest or by `.zip`.
The `eth_decrypt` used to fail on Firefox with a recursion error. Updating these `tweetnacl` dependencies seemed to have fixed the issue the last time I tested this. When I tried to reproduce the failure today, it failed due to a different reason, both before and after this update. But nonetheless, it still seems like a good idea to update. These newer versions have no breaking changes and contain important bug fixes.
The TokenList component on the `add-token` page had the name `InfoBox`, which doesn't seem applicable. It has been renamed to `TokenList`, to match the module filename and the component name we use elsewhere.
* origin/develop: (22 commits) Fix TokenList component name (#10030) Update `tweetnacl` dependencies (#10028) Rename `lockdown.cjs` to `lockdown.js` (#10026) Revert "Revert "Add SES lockdown to extension webapp (#9729)"" Revert "Revert "Remove redundant babelify (#9945)"" Add hidden tokens to store (#9320) @metamask/inpage-provider@^8.0.0 (#8640) Log persistence errors with Sentry (#10018) Fix SES lockdown on older browsers (#10014) Reapply view quote screen designs (#9905) Fix unbound metrics track function (#10016) Deobfuscate error message (#10012) Add SES lockdown and Sentry to all pages (#10013) Remove web3 injection (#9156) Initialize network controller provider chainId to the appropriate default networks (#9999) Fix Infura network chain IDs (#8629) Prevent props error in swaps gas modal (#10001) Fix 9906 - Prevent unwanted 'no quotes available' message when going back to build quote screen while having insufficient funds (#9994) Fix 9988 - Don't allow more than 15% slippage (#9991) Bump highlight.js from 10.4.0 to 10.4.1 (#10004) ...
Sync `master` with `develop`
The Chrome minimum version has been increased from v58 to v63. We found that we had very few users on versions below v63, and v62 is incompatible with our SES lockdown dependency. This also makes us compatible with Object rest/spread syntax, so we might not have to transpile that anymore. I'll revisit that separately.
On Firefox 56 and Waterfox Classic, our `runLockdown.js` script throws an error. This is fine on the HTML pages, as the next script tags still get run without issue (though they don't benefit from the SES lockdown sadly). But in the `contentscript`, an exception thrown here appears to halt the execution of subsequent scripts. To prevent the `contentscript` from crashing completely, lockdown errors are now caught and logged. They are also logged to Sentry on the pages where Sentry is setup.
Additional validation was added in #9907 to ensure that the "Known contract address" warning was shown when sending tokens to another token address after switching assets on the Send screen. Unfortunately this change had the unintended side-effect of preventing _all_ token sends after switching assets, so long as the recipient was not an internal address. The problem is that the `validate` function expects to be passed the address of the token send recipient in the case where a token is selected. Instead the token address was being passed to the validate function. The `query` state is now used, which should always contain the recipient address. This is the same state used in the only other place the `validate` function is called.
* origin/develop: (66 commits) Disable swaps based on chainId, instead of network id (#10155) improve handling of last selected provider (#10093) Add links to Community Forum to README (#10152) @metamask/contract-metadata@1.21.0 (#10142) Prevent malformed next nonce warning (#10143) add module resolution for node-analytics/axios (#10139) Ensure that gas for swap tx submitted at same time as approval is in hex (#10135) Fix useTransactionDisplayData unit tests (#10134) Fix network settings Kovan block explorer link (#10117) Use destructured signal (#10115) throw a new wrapped error instead of default one from segment (#10118) @metamask/contract-metadata@1.20.0 (#10116) Use late-bound noop function when disabling console (#10110) Bump @metamask/contract-metadata from 1.19.0 to 1.20.0 (#10104) Remove unnecessary swaps footer space when in dropdown mode (#10100) Tighten up loading indication logic (#10103) Skip reporting of successive persistence failures (#10099) Update `@metamask/controllers` to v5.1.0 (#10096) @metamask/obs-store@5.0.0 (#10092) set last provider when switching to a customRPC (#10084) ...
Sync `master` with `develop`
9f4e32a to
341b4c6
Compare
Collaborator
Author
Builds ready [341b4c6]
Page Load Metrics (676 ± 65 ms)
|
Gudahtt
reviewed
Jan 7, 2021
341b4c6 to
5ebc6bf
Compare
Member
|
Rebased to include #10160, and updated changelog per comment. |
Member
|
Converted to draft again because we may very well include minor fixes that land on |
Collaborator
Author
Builds ready [5ebc6bf]
Page Load Metrics (561 ± 37 ms)
|
Our automatic token detection was hard-coded to only work on our built- in Infura Mainnet endpoint. It now works with custom Mainnet RPC endpoints as well. Relates to #6992
* Update zh_CN translation * Translate 'Gas Limit' to 'Gas 上限' Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
…ders (#10170) * Migration 51: ensure chainId is set in network controller provider state for all infura/default networks * Clean up * Migrate incorrect as well as falsy chainIds Co-authored-by: Erik Marks <rekmarks@protonmail.com>
* Add 9.0.0 changelog * Add #10040 entry to v8.1.9 * Run `prettier` on changelog to get rid of editor syntax warnings
5ebc6bf to
384e812
Compare
Collaborator
Author
Builds ready [384e812]
Page Load Metrics (550 ± 34 ms)
|
Collaborator
Author
Builds ready [376e846]
Page Load Metrics (531 ± 39 ms)
|
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.
📦 🚀
Changelog