From 944a499ff59c30b9d27be3274a60c1fabbfa0254 Mon Sep 17 00:00:00 2001 From: Conflux Bot <59952071+ConfluxBot@users.noreply.github.com> Date: Mon, 10 Feb 2020 14:35:00 +0800 Subject: [PATCH] Master => develop (#34) * Fix: release file blob * Fix: circle ci artifact url * Docs: issue templates, codeowners, docs, support emails * Docs: move docs to conflux-portal-docs * Fix: MetaMask -> ConfluxPortal in announcement script * Fix: disable misleading changelog prefix * Fix: shelllint * Add page navigation to e2e web driver (#7867) The driver now has a page navigation function that can navigate to any of the three primary pages used in the extension. Additional pages and support of paths can be added later as needed. * Revert the revert of "Use common test build during CI (#7196)" (#7404) (#7870) This reverts commit 4b4c00e94fbb2f38746521864a568aab1400aac4. The original change was a possible optimization of CI, though it ended up not having a huge impact. It was thought that it may have broken source maps, because the test build overwrote the `dist` directory that the source maps were written to. However this turned out not to be the case, as the changes to `dist` are never persisted to the workspace. This is being re-introduced because the test build is needed for an additional job (the page load benchmark), and sharing the same build for all three jobs would surely be faster than building it separately three times. * Add `withFixtures` helper and simple-send test (#7862) The `withFixtures` helper will instantiate ganache, a web driver, and a fixture server initialized with the given set of fixtures. It is meant to facilitating writing small, isolated e2e tests. The first example test has been added: simple-send. It ensures that the user can send 1 ETH to another account. These new e2e tests will run during the normal e2e test run. Closes #6548 * Add 1 second pause at the beginning of each e2e test run (#7872) There have been intermittent test failures at the beginning of various e2e test runs. Most tests start with waiting for the 'Welcome' button to be visible and enabled, which means waiting for the loading screen to go away. It looks like the reason the test intermittently fails is that sometimes the loading screen doesn't appear until a few moments _after_ the page loads (or that it vanishes and comes back). It was rather difficult to track down each possible cause for the loading screens, so in the meantime a pause has been added at the start of each run. This should hopefully suffice to ensure the momentary gap in loading has been passed by the time the first test starts up. * Remove unnecessary `shouldComponentUpdate` (#7875) The `confirm-seed-phrase` component extends PureComponent, so it doesn't need a `shouldComponentUpdate` function. The state is effectively immutable, as all state is either a primitive type or is updated with new instances rather than mutation. Removing this function will silence a warning message printed to the console during e2e tests (React doesn't want you to set this function on `PureComponent`s). Removing this function also exposed an unused piece of state, which has also been removed. * Fix intermittent e2e test failure (#7873) The 'can retype the seed phrase' test would fail sometimes when one of the words in the seed phrase was a subset of another word (e.g. 'issue' and 'tissue'). This is because the selector used to find the word looked for the first element that contained the text, rather than an exact match. To simplify the selector and make it more reliable, test ids were added to each seed phrase word. The selector now uses CSS instead of XPath, and it only finds exact matches. A test id was also added to the div containing the shuffled seed words to select from, so that the chosen seed words wouldn't be selected in place of the real target when the same word appears twice. * Add benchmark script (#7869) The script `benchmark.js` will collect page load metrics from the extension, and print them to a file or the console. A method for collecting metrics was added to the web driver to help with this. This script will calculate the min, max, average, and standard deviation for four metrics: 'firstPaint', 'domContentLoaded', 'load', and 'domInteractive'. The variation between samples is sometimes high, with the results varying between samples if only 3 were taken. However, all tests I've done locally with 5 samples have produced results within one standard deviation of each other. The default number of samples has been set to 10, which should be more than enough to produce consistent results. The benchmark can be run with the npm script `benchmark:chrome` or `benchmark:firefox`, e.g. `yarn benchmark:chrome`. * Update inpage provider (#7878) * Remove unused browser-passworder dependency from package.json (#7879) * Change "Log In/Out" terminology to "Unlock/Lock" (#7853) * log out/in -> lock/unlock * Add mechanism to randomize seed phrase filename (#7863) The filename is seeded by a simple use of Math.random() pulling from an alphanumeric character bank, as opposed to a more cryptographically random solution. This provides a simple layer of difficulty for bad actors to seek out the recovery phrase file. * Use shared MetaMask ESLint config (#7882) * Remove unnecessary WebRTC shim (#7886) The WebRTC spec is fairly stable these days, particularly among the browsers we support. We don't need this shim for anything. I'm guessing it may have been added primarily with IE in mind. * Replace DetectRTC package with standard web APIs (#7887) The only web API that our usage of DetectRTC relied upon was 'enumerateDevices', which is supported and stable among all of our supported browsers. Note that the error handling here is a little... non-standard, and the logic around how Firefox and Brave are handled should be justified, but I've left the logic as-is for now to keep this PR small. * Add benchmark to CI (#7871) * Add benchmark to CI The page load benchmark for Chrome is now run during CI, and the results are collected and summarized in the `metamaskbot` comment. Closes #6881 * Double default number of samples The number of default samples was changed from 10 to 20. The results from 10 samples would show statistically significant changes in page load times between builds, so weren't a sufficiently useful metric. * Use ref in Mascot component rather than reaching into DOM directly (#7893) Accessing the dom via `document` is strongly discouraged in React. Instead the DOM element is now referenced by ref instead. * Remove unnecessary `withRouter` and `compose` calls (#7890) `withRouter` has been removed from any components that were not using any of the three props injected by `withRouter`: `history`, `location`, and `match`. `compose` is a no-op when called upon a single component, so it has been removed in all such cases. * Remove unnecessary get environment type parameter (#7891) * Remove unnecessary `getEnvironmentType` parameter The default value of the first parameter is `window.location.href`, so there is no need to pass it in explicitly. * Remove junk parameter from `getEnvironmentType` invocation `getEnvironmentType` doesn't need to be passed any parameter, as the default value is `window.location.href` which is generally what is wanted. In this case, the variable `location.href` was always `undefined` anyway. This particular `location` variable is from React Router, and does not have an `href` property. * Fix comment for `getEnvironmentType` One of the possible return values was referred to by the wrong name. * Add top-level error page (#7889) Any error caught during a React component render or lifecycle method will now be caught by the top-level error boundary, which shows the user this new error page. The error page will display a simple error message, and will show the details of the error in a collapsible section. The caught error is also reported to Sentry. In development the error will be re-thrown to make it easier to see on the console, but it is not re-thrown in production. * Update GABA dependency version (#7894) * Replace `request-promise` with `node-fetch` (#7899) `node-fetch` is a smaller and simpler project than `request-promise`, and we already have it as a transitive dependency. `request-promise` was also incorrectly listed as a production dependency. `node-fetch` has been added as a `devDependency` to replace it, as it was only used in one CI script. * Update Sentry to v5.x (#7880) Theses changes were made in accordance with the provided migration guide [1]. The two integrations added were included by default on v4.x, so this shouldn't result in any change in behavior. [1]: https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md * Minimum changes to get storybook working (#7884) * Minimum changes to get storybook working Undo path changes * Add build:storybook scripts to package.json * Add storybook deployer * Add storybook:deploy to package.json * Update circle ci config * Update yarn.lock * Remove addon-info * Update yarn.lock file to reflect removing of addon-info Co-authored-by: Dan J Miller * Fixing broken JSON import help link (#7910) * Remove xtend from the dependencies list (#7902) * Update `classnames` to `v2.2.6` (#7906) This patch update includes a bug fix for ES6 imports. The bug doesn't affect our use of this module, but it ensures that we can safely use the `dedupe` and `bind` APIs as ES6 imports if we decide to. * Replace bluebird with Node.js API for unhandled rejections (#7904) Unhandled rejections are now caught using built-in Node.js APIs instead of with `bluebird`. `bluebird` was added as a production dependency but was only used for this purpose. The code responsible for catching unhandled rejection in the browser was removed, as this test helper is never run in the browser. Additionally, unhandled rejections are tracked over the course of all tests, and result in a non-zero exit code if they remain at the end. This was done because it is possible for errors to trigger the `uncaughtRejection` event but then still be handled later on. This is uncommon, and doesn't seem to happen in our test suite. But if it does in the future, it'll be logged but won't result in a non-zero exit code. * Comment out `storybook-deploy` step (#7913) The Storybook deploy step is currently broken because it's using the wrong source branch (`master` instead of `develop`), and because the key that CircleCI is setup with doesn't have write access to the repo. While I expect we'll get these two problems fixed soon, this ensures that we at least have passing builds on `develop` in the meantime. * Switch to full lodash package, and update lodash (#7907) * Update lodash All versions of the full `lodash` package have been updated to 4.17.15. The only exception is v4.17.14 which is pinned by `ganache-core`. * Switch to using `lodash` instead of per-method packages We have the full lodash package _ten times_ as a production transitive dependency, so including per-method packages is not saving space (it might instead result in slightly more space being used). * Update `c3` and `d3` (#7905) This updates include a number of bug fixes. The two charts we use these libraries for appear unaffected. * Replace `deep-extend` with `merge` from `lodash` (#7908) The `merge` function from `deep-extend` is at least mostly equivalent to `merge` from `lodash` - certainly in how we're using it. * Improve LoginPerSite UX/devX and permissions logging (#7649) Update accounts permission history on accountsChanged Create PermissionsLogController Fix permissions activity log pruning Add selectors, background hooks for better UX Make selected account the first account returned Use enums for store keys in log controller Add last selected address history to PreferencesController * disable import button on Import Account screen for empty string/file (#7912) * disable import button on Import Account screen for empty string/file * use refs to access DOM for import-account * Update data on Approve screen after updating custom spend limit (#7918) After updating the custom spend limit on the approve screen, the data for the transaction was not being updated. Instead it showed the original transaction data. The transaction data was being updated correctly in the final transaction though. The approve screen has been updated to ensure changes to the custom spend limit are reflected correctly in the data shown. * Remove usage of unlisted extend dependency (#7903) * Remove JSDoc tools (#7897) Our JSDoc documentation has not been updated in a very long time, and we don't use JSDoc in enough places for the docs to have been especially useful. The tools and scripts used to generate and publish these docs have been removed. References to this documentation have also been removed from the README. Hopefully once the TypeScript migration has made substantial progress, we can generate more useful documentation using something like TypeDoc. * Update jazzicon component (#7898) * Use ref instead of findDOMNode in jazzicon component The jazzicon component was using `findDOMNode` to get the DOM node for the main div returned by the component, which is generally not recommended. Instead a ref is now used. * Update Jazzicon to v2 This version drops the dependency upon `raphael`, and no longer uses the function `createSVGMatrix` which was causing unit tests to fail (because it's not supported by jsdom). * Allow editing max spend limit (#7919) In the case where the initial spend limit for the `approve` function was set to the maximum amount, editing this value would result in the new limit being silently ignored. The transaction would be submitted with the original max spend limit. This occurred because function to generate the new custom data would look for the expected spend limit in the existing data, then bail if it was not found (and in these cases, it was never found). The reason the value was not found is that it was erroneously being converted to a `Number`. A JavaScript `Number` is not precise enough to represent larger spend limits, so it would give the wrong hex value (after rounding had taken place in the conversion to a floating-point number). The data string is now updated without relying upon the original token value; the new value is inserted after the `spender` argument instead, as the remainder of the `data` string is guaranteed to be the original limit. Additionally, the conversion to a `Number` is now omitted so that the custom spend limit is encoded correctly. Fixes #7915 * Report errors in tests to `test-metamask` Sentry project (#7924) Previously, all errors encountered during testing or production were sent to the primary `metamask` Sentry project, whereas development errors were sent to `test-metamask` instead. This change ensures that errors encountered during tests are sent to `test-metamask` as well. * Bump Node version to 10.18 (#7925) * Remove top-level symlinks (#7927) * Replace `clone` dependency with `cloneDeep` from lodash (#7926) This was done to reduce the number of direct dependencies we have. It should be functionally equivalent. The bundle size should not change, as we use `clone` as a transitive dependency in a number of places. * Remove redux-logger from mock-store (#7930) * Delete unused .dockerignore file (#7929) * Replace `debounce` package with `debounce` function from `lodash` (#7931) These two functions differ slightly in options, but none of those options are being used by us, so in these cases they're functionally equivalent. They're even both descendants of the original `debounce` function from `underscore`. This was done to reduce the number of direct dependencies we have. It should not affect bundle size, as we still depend upon the `debounce` package transitively. * Remove unused promise-filter dependency (#7932) * Validate custom spend limit (#7920) The custom spend limit was previously not validated. It did have a minimum of zero set, but this didn't have any affect (that minimum is used for form constraint validation, and this field wasn't in a form). The field was never checked to ensure the contents didn't exceed the maximum. The field is now checked for values that exceed the maximum, and invalid values in general (including negative values). The parameters to the `showEditApprovalPermissionModal` were also alphabetized to make them easier to read. In the course of doing this, I noticed that the origin was missing from one of the calls. This was responsible for the modal saying "Spend limit requested by undefined" when clicking "Edit" under the transaction details. This has been fixed. * Delete outdated team page (#7928) * Replace mkdirp with built-in functionality (#7934) * Sorting seed phrase confirmation buttons alphabetically (#7933) * Replace fast-deep-equal with isEqual from lodash (#7935) * Move devDeps into devDeps (#7936) * Remove unused number-to-bn package (#7937) * Add Sentry environment (#7923) Any error sent to Sentry will now be marked with the environment they were sent from. The environment is set at build time, and is set dependant upon the build flags and CI-related environment variables. Setting the environment will let us filter error reports in Sentry to focus specifically upon reports sent from production, release candidates, PR testing, or whatever else. * Move polyfill-crypto.getrandomvalues to devDeps (#7938) * Remove unused fs-extra and fs-promise devDependencies (#7939) * Remove unused rimraf devDependency (#7940) * Remove unnecessary 'path' dependency (#7942) * Only resolve ENS on mainnet (#7944) The ENS resolver will now bail on any network other than mainnet. * Remove unused mocha-eslint dependency (#7943) * Inline isomorphic-fetch test helper (#7945) * Remove dead link to team page in README (#7946) * Remove mocha-jsdom and mocha-sinon (#7947) * Explicitly set Sass compiler for gulp-sass (#7948) As per the gulp-sass docs [1] we should be setting the `sass.compiler` property for forwards-compatibility "in case the default ever changes." [1]:https://github.com/dlmanning/gulp-sass/tree/v4.0.2#basic-usage * ci: Update shellcheck version used in CI (#7951) * Move issue template and contributing doc to .github (#7952) * Remove gulp-eslint and gulp-util dependency (#7949) * Update ENS registry addresses (#7954) * Bump tree-kill version to fix high-severity vulnerability (#7956) * Bump node-sass to fix low-severity vulnerability (#7955) * Remove cross-env (#7950) * Various component tests and some conditional statements (#7765) * Various component tests and some conditional statements Conditional in account-menu in removeAccount when keyring sometimes is not initially provideed Conditional on unlock-page when there is no target.getBoundingClientRect on the element. * Update helpers * Remove component debugging * Add default params for render helpers * Remove stubComponent for old Mascot Changes in https://github.com/MetaMask/metamask-extension/pull/7893 has prevented the need to stub it out. Change logout to lock in account-menu test * Update ethereum-ens-network-map in lockfile (#7959) * Update yarn.lock cross-spawn versions * Use ethereum-ens-network-map@1.0.2 * Use ethereum-ens-network-map for network support (#7960) * Add margin of error metric (#7877) * Fix: syntax error * Fix: lint * Fix: unit tests * Fix: settings network tab react dup key error * Fix: no need to pass benchmark test to release for now * Updating deprecated Etherscam link (#7464) Co-authored-by: Whymarrh Whitby * Use envify@4.1.0 (#7983) * Use eth-json-rpc-infura@4.0.2 (#7981) * Use eth-keyring-controller@5.5.0 (#7980) * Use gulp@4.0.2 (#7982) * Remove redundant eth-*-keyring versions from yarn.lock (#7984) * Fixes #5706 - Adds Dai/Sai to currency display (#7986) With the change from infura to cryptocompare https://github.com/MetaMask/gaba/pull/30/files#diff-50c3c47cc5fa12e5213a6cc900476f41L41-R48 we have numerous conversion rates to go through and add if we like to. * Fix: speedup tx * Add: testnet to http://testnet-jsonrpc.conflux-chain.org:12537/ * Fix: sign typed data * Fix: conflicts with metamask, add testnet chainid * Fix: test:lint * Version v0.0.5 Co-authored-by: yqrashawn Co-authored-by: Mark Stacey Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com> Co-authored-by: Whymarrh Whitby Co-authored-by: ryanml Co-authored-by: ricky Co-authored-by: Dan J Miller Co-authored-by: Brandon Lucas <38222767+thebrandonlucas@users.noreply.github.com> Co-authored-by: Thomas Huang Co-authored-by: Alice Henshaw <34962750+alicevhenshaw@users.noreply.github.com> --- CHANGELOG.md | 3 +++ app/manifest.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d224ca9ae049..729851afc0ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## Current Develop Branch - [#7912](https://github.com/MetaMask/metamask-extension/pull/7912): Disable import button for empty string/file +## 0.0.5 Mon Feb 10 2020 +- [#7912](https://github.com/MetaMask/metamask-extension/pull/7912): Disable import button for empty string/file + ## 0.0.4 Mon Jan 20 2020 - [#7823](https://github.com/Conflux-Chain/conflux-portal/pull/7823): Wait until element is clickable before clicking in e2e tests (#7823) - [#7833](https://github.com/Conflux-Chain/conflux-portal/pull/7833): Fix prop types for SendGasRow component tests (#7833) diff --git a/app/manifest.json b/app/manifest.json index 3661eb9e82ea..88904d789321 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "0.0.4", + "version": "0.0.5", "manifest_version": 2, "author": "https://conflux-chain.org", "description": "__MSG_appDescription__",