From 230d43176d92c470260c9d86230355733eb97642 Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 24 Jul 2020 15:47:40 -0700 Subject: [PATCH 01/44] Fixes MetaMask/metamask-extension#8626 - verifies password on requesting seed phrase (#9063) --- app/scripts/metamask-controller.js | 10 ++++++++++ package.json | 2 +- ui/app/store/actions.js | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 3f1511333..5aa4539e3 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -478,6 +478,7 @@ export default class MetamaskController extends EventEmitter { // vault management submitPassword: nodeify(this.submitPassword, this), + verifyPassword: nodeify(this.verifyPassword, this), // network management setProviderType: nodeify(networkController.setProviderType, networkController), @@ -808,6 +809,15 @@ export default class MetamaskController extends EventEmitter { return this.keyringController.fullUpdate() } + /** + * Submits a user's password to check its validity. + * + * @param {string} password The user's password + */ + async verifyPassword (password) { + await this.keyringController.verifyPassword(password) + } + /** * @type Identity * @property {string} name - The account nickname. diff --git a/package.json b/package.json index d0b2a48b6..a433b99cd 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "eth-json-rpc-filters": "^4.1.1", "eth-json-rpc-infura": "^4.0.2", "eth-json-rpc-middleware": "^5.0.2", - "eth-keyring-controller": "^6.0.1", + "eth-keyring-controller": "^6.1.0", "eth-method-registry": "^1.2.0", "eth-phishing-detect": "^1.1.4", "eth-query": "^2.1.2", diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index abb855233..49a43da24 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -168,7 +168,7 @@ export function createNewVault (password) { export function verifyPassword (password) { return new Promise((resolve, reject) => { - background.submitPassword(password, (error) => { + background.verifyPassword(password, (error) => { if (error) { return reject(error) } @@ -193,7 +193,7 @@ export function verifySeedPhrase () { export function requestRevealSeedWords (password) { return async (dispatch) => { dispatch(showLoadingIndication()) - log.debug(`background.submitPassword`) + log.debug(`background.verifyPassword`) try { await verifyPassword(password) diff --git a/yarn.lock b/yarn.lock index 0290b9ac1..30f8e5ecf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10131,10 +10131,10 @@ eth-keyring-controller@^5.3.0, eth-keyring-controller@^5.6.1: loglevel "^1.5.0" obs-store "^4.0.3" -eth-keyring-controller@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.0.1.tgz#6a4cdd5802b0587320c711be6c1752b2a88221aa" - integrity sha512-60j71F1HgLcvwzg7U5R45bA/kgQSUlmiZrsUIIhW4qS7QOYqJn0OQ64enf0ZaxMMPVVcKSfCDersYJiqm/yrlw== +eth-keyring-controller@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.1.0.tgz#dc9313d0b793e085dc1badf84dd4f5e3004e127e" + integrity sha512-wPxH++98VDBcDv9YkPzxhZC0gF1ixuRbyKR2u/NOT/roBpNQDe4reqyllBRC7jhPehiKnRxzf7r6HEyirRnPxQ== dependencies: bip39 "^2.4.0" bluebird "^3.5.0" From f9e4023b048454e20cf6e559f4efeb32f6defd38 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Mon, 27 Jul 2020 11:33:25 -0700 Subject: [PATCH 02/44] Fix popup/notification when browser is in fullscreen, primarily on macOS. (#9075) * Fix popup/notification when browser is in fullscreen, primarily on OSX. The issue was reported internally via Slack. User was running Mac OSX Chrome in fullscreen mode where Chrome is created in a new Desktop workspace. The issue reproduced on OSX Chrome in fullscreen/maximized view overrides the explicitly set width and height for `windows.create()`. Possibly not overrides, but creates a window based off of the window that it was created from. Found a related [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=263092&q=window%20create%20width%20os%3DMac&can=2). The fullscreen `popup.left` pixel will calculate the window position incorrectly since we set and assume the width of the created window. The incorrect `left` position the window and transition the focus Desktop/Workspace incorrectly and make is seem to lose focus of the new window/workspace. Incidentally this will make the popup full width/height, and create a new workspace for the view, which we have no control over until Chrome fixes it. This will check if the popup is 'fullscreen', which it gets passed from the origin window, if so then don't reposition the window. If Chrome fixes the issue we can revert this change. * Feedback commit Co-authored-by: Mark Stacey Co-authored-by: Mark Stacey --- app/scripts/lib/notification-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 497100354..631ae3290 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -56,7 +56,7 @@ export default class NotificationManager { }) // Firefox currently ignores left/top for create, but it works for update - if (popupWindow.left !== left) { + if (popupWindow.left !== left && popupWindow.state !== 'fullscreen') { await this.platform.updateWindowPosition(popupWindow.id, left, top) } this._popupId = popupWindow.id From 7cf930f5f8d823af2f8e4a26f453f3bc16eb91a6 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Mon, 27 Jul 2020 15:01:21 -0500 Subject: [PATCH 03/44] support longer text in network dropdown (#9085) --- ui/app/css/itcss/components/network.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/css/itcss/components/network.scss b/ui/app/css/itcss/components/network.scss index 194a59fbd..02d0dcfcd 100644 --- a/ui/app/css/itcss/components/network.scss +++ b/ui/app/css/itcss/components/network.scss @@ -175,7 +175,7 @@ } .network-dropdown-content { - height: 36px; + min-height: 36px; width: 265px; color: $dusty-gray; font-family: Roboto; From 1819606f93ae95568f907ebddc9c389198b6482a Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 27 Jul 2020 14:03:26 -0700 Subject: [PATCH 04/44] Complete onboarding upon importing/verifying seed (#8873) Fixes #8679 --- .../import-with-seed-phrase.component.js | 6 ++++-- .../import-with-seed-phrase.container.js | 2 ++ .../first-time-flow/end-of-flow/end-of-flow.component.js | 4 +--- .../first-time-flow/end-of-flow/end-of-flow.container.js | 9 +-------- .../end-of-flow/tests/end-of-flow.test.js | 2 -- .../confirm-seed-phrase/confirm-seed-phrase.component.js | 8 +++++++- .../confirm-seed-phrase/confirm-seed-phrase.container.js | 2 ++ .../tests/confirm-seed-phrase-component.test.js | 1 + 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index b13088915..2c3dc1c78 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -19,6 +19,7 @@ export default class ImportWithSeedPhrase extends PureComponent { onSubmit: PropTypes.func.isRequired, setSeedPhraseBackedUp: PropTypes.func, initializeThreeBox: PropTypes.func, + completeOnboarding: PropTypes.func, } state = { @@ -119,7 +120,7 @@ export default class ImportWithSeedPhrase extends PureComponent { } const { password, seedPhrase } = this.state - const { history, onSubmit, setSeedPhraseBackedUp, initializeThreeBox } = this.props + const { history, onSubmit, setSeedPhraseBackedUp, initializeThreeBox, completeOnboarding } = this.props try { await onSubmit(password, this.parseSeedPhrase(seedPhrase)) @@ -131,7 +132,8 @@ export default class ImportWithSeedPhrase extends PureComponent { }, }) - setSeedPhraseBackedUp(true).then(() => { + setSeedPhraseBackedUp(true).then(async () => { + await completeOnboarding() initializeThreeBox() history.push(INITIALIZE_END_OF_FLOW_ROUTE) }) diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js index 32038e07d..018666b13 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js @@ -3,12 +3,14 @@ import ImportWithSeedPhrase from './import-with-seed-phrase.component' import { setSeedPhraseBackedUp, initializeThreeBox, + setCompletedOnboarding, } from '../../../../store/actions' const mapDispatchToProps = (dispatch) => { return { setSeedPhraseBackedUp: (seedPhraseBackupState) => dispatch(setSeedPhraseBackedUp(seedPhraseBackupState)), initializeThreeBox: () => dispatch(initializeThreeBox()), + completeOnboarding: () => dispatch(setCompletedOnboarding()), } } diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js index 275dcc587..a6510553d 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.component.js @@ -14,7 +14,6 @@ export default class EndOfFlowScreen extends PureComponent { static propTypes = { history: PropTypes.object, - completeOnboarding: PropTypes.func, completionMetaMetricsName: PropTypes.string, onboardingInitiator: PropTypes.exact({ location: PropTypes.string, @@ -23,9 +22,8 @@ export default class EndOfFlowScreen extends PureComponent { } onComplete = async () => { - const { history, completeOnboarding, completionMetaMetricsName, onboardingInitiator } = this.props + const { history, completionMetaMetricsName, onboardingInitiator } = this.props - await completeOnboarding() this.context.metricsEvent({ eventOpts: { category: 'Onboarding', diff --git a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js index 61af2fdaa..d52f74dbc 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js +++ b/ui/app/pages/first-time-flow/end-of-flow/end-of-flow.container.js @@ -1,6 +1,5 @@ import { connect } from 'react-redux' import EndOfFlow from './end-of-flow.component' -import { setCompletedOnboarding } from '../../../store/actions' import { getOnboardingInitiator } from '../../../selectors' const firstTimeFlowTypeNameMap = { @@ -17,10 +16,4 @@ const mapStateToProps = (state) => { } } -const mapDispatchToProps = (dispatch) => { - return { - completeOnboarding: () => dispatch(setCompletedOnboarding()), - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(EndOfFlow) +export default connect(mapStateToProps)(EndOfFlow) diff --git a/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js b/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js index 56f4aba0d..2cc5b9710 100644 --- a/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js +++ b/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js @@ -12,7 +12,6 @@ describe('End of Flow Screen', function () { history: { push: sinon.spy(), }, - completeOnboarding: sinon.spy(), } beforeEach(function () { @@ -30,7 +29,6 @@ describe('End of Flow Screen', function () { endOfFlowButton.simulate('click') setImmediate(() => { - assert(props.completeOnboarding.calledOnce) assert(props.history.push.calledOnceWithExactly(DEFAULT_ROUTE)) done() }) diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js index 18f496ca7..8847a0d01 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js @@ -26,6 +26,7 @@ export default class ConfirmSeedPhrase extends PureComponent { seedPhrase: PropTypes.string, initializeThreeBox: PropTypes.func, setSeedPhraseBackedUp: PropTypes.func, + completeOnboarding: PropTypes.func, } state = { @@ -66,6 +67,10 @@ export default class ConfirmSeedPhrase extends PureComponent { exportAsFile('', this.props.seedPhrase, 'text/plain') } + setOnboardingCompleted = async () => { + await this.props.completeOnboarding() + } + handleSubmit = async () => { const { history, @@ -86,8 +91,9 @@ export default class ConfirmSeedPhrase extends PureComponent { }, }) - setSeedPhraseBackedUp(true).then(() => { + setSeedPhraseBackedUp(true).then(async () => { initializeThreeBox() + this.setOnboardingCompleted() history.push(INITIALIZE_END_OF_FLOW_ROUTE) }) } catch (error) { diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js index 393998f8d..176601e49 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js @@ -3,12 +3,14 @@ import ConfirmSeedPhrase from './confirm-seed-phrase.component' import { setSeedPhraseBackedUp, initializeThreeBox, + setCompletedOnboarding, } from '../../../../store/actions' const mapDispatchToProps = (dispatch) => { return { setSeedPhraseBackedUp: (seedPhraseBackupState) => dispatch(setSeedPhraseBackedUp(seedPhraseBackupState)), initializeThreeBox: () => dispatch(initializeThreeBox()), + completeOnboarding: () => dispatch(setCompletedOnboarding()), } } diff --git a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js index 449bd3347..a5846a944 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js +++ b/ui/app/pages/first-time-flow/seed-phrase/tests/confirm-seed-phrase-component.test.js @@ -142,6 +142,7 @@ describe('ConfirmSeedPhrase Component', function () { history: { push: pushSpy }, setSeedPhraseBackedUp: () => Promise.resolve(), initializeThreeBox: initialize3BoxSpy, + completeOnboarding: sinon.spy(), }, { metricsEvent: metricsEventSpy, From 1591ed7657bbc07496758e6704083b08bd79d33a Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 27 Jul 2020 14:35:09 -0700 Subject: [PATCH 05/44] Robustify permissions controller requestUserApproval tests (#9064) * convert requestUserApproval mock to wrapper --- .../app/controllers/permissions/helpers.js | 43 +++++++++++++------ .../permissions-controller-test.js | 41 +++++++----------- .../permissions-middleware-test.js | 31 ++++++++++++- 3 files changed, 77 insertions(+), 38 deletions(-) diff --git a/test/unit/app/controllers/permissions/helpers.js b/test/unit/app/controllers/permissions/helpers.js index 8879329a4..0378dc089 100644 --- a/test/unit/app/controllers/permissions/helpers.js +++ b/test/unit/app/controllers/permissions/helpers.js @@ -19,25 +19,44 @@ export function grantPermissions (permController, origin, permissions) { } /** - * Sets the underlying rpc-cap requestUserApproval function, and returns - * a promise that's resolved once it has been set. + * Returns a wrapper for the given permissions controller's requestUserApproval + * function, so we don't have to worry about its internals. * - * This function must be called on the given permissions controller every - * time you want such a Promise. As of writing, it's only called once per test. + * @param {PermissionsController} permController - The permissions controller. + * @return {Function} A convenient wrapper for the requestUserApproval function. + */ +export function getRequestUserApprovalHelper (permController) { + /** + * Returns a request object that can be passed to requestUserApproval. + * + * @param {string} id - The internal permissions request ID (not the RPC request ID). + * @param {string} [origin] - The origin of the request, if necessary. + * @returns {Object} The corresponding request object. + */ + return (id, origin = 'defaultOrigin') => { + return permController.permissions.requestUserApproval({ metadata: { id, origin } }) + } +} + +/** + * Returns a Promise that resolves once a pending user approval has been set. + * Calls the underlying requestUserApproval function as normal, and restores it + * once the Promise is resolved. + * + * This function must be called on the permissions controller for each request. * * @param {PermissionsController} - A permissions controller. * @returns {Promise} A Promise that resolves once a pending approval * has been set. */ export function getUserApprovalPromise (permController) { - return new Promise((resolveForCaller) => { - permController.permissions.requestUserApproval = async (req) => { - const { origin, metadata: { id } } = req - - return new Promise((resolve, reject) => { - permController.pendingApprovals.set(id, { origin, resolve, reject }) - resolveForCaller() - }) + const originalFunction = permController.permissions.requestUserApproval + return new Promise((resolveHelperPromise) => { + permController.permissions.requestUserApproval = (req) => { + const userApprovalPromise = originalFunction(req) + permController.permissions.requestUserApproval = originalFunction + resolveHelperPromise() + return userApprovalPromise } }) } diff --git a/test/unit/app/controllers/permissions/permissions-controller-test.js b/test/unit/app/controllers/permissions/permissions-controller-test.js index 98b0cd55d..1b4f315a3 100644 --- a/test/unit/app/controllers/permissions/permissions-controller-test.js +++ b/test/unit/app/controllers/permissions/permissions-controller-test.js @@ -15,6 +15,7 @@ import { } from '../../../../../app/scripts/controllers/permissions' import { + getRequestUserApprovalHelper, grantPermissions, } from './helpers' @@ -58,12 +59,6 @@ const initPermController = (notifications = initNotifications()) => { }) } -const getMockRequestUserApprovalFunction = (permController) => (id, origin) => { - return new Promise((resolve, reject) => { - permController.pendingApprovals.set(id, { origin, resolve, reject }) - }) -} - describe('permissions controller', function () { describe('getAccounts', function () { @@ -951,13 +946,11 @@ describe('permissions controller', function () { describe('approvePermissionsRequest', function () { - let permController, mockRequestUserApproval + let permController, requestUserApproval beforeEach(function () { permController = initPermController() - mockRequestUserApproval = getMockRequestUserApprovalFunction( - permController, - ) + requestUserApproval = getRequestUserApprovalHelper(permController) }) it('does nothing if called on non-existing request', async function () { @@ -994,14 +987,14 @@ describe('permissions controller', function () { PERMS.requests.eth_accounts(), ) - const requestRejection = assert.rejects( - mockRequestUserApproval(REQUEST_IDS.a), + const rejectionPromise = assert.rejects( + requestUserApproval(REQUEST_IDS.a), ERRORS.validatePermittedAccounts.invalidParam(), - 'should reject bad accounts', + 'should reject with "null" accounts', ) await permController.approvePermissionsRequest(request, null) - await requestRejection + await rejectionPromise assert.equal( permController.pendingApprovals.size, 0, @@ -1014,7 +1007,7 @@ describe('permissions controller', function () { const request = PERMS.approvedRequest(REQUEST_IDS.a, {}) const requestRejection = assert.rejects( - mockRequestUserApproval(REQUEST_IDS.a), + requestUserApproval(REQUEST_IDS.a), ERRORS.approvePermissionsRequest.noPermsRequested(), 'should reject if no permissions in request', ) @@ -1036,7 +1029,7 @@ describe('permissions controller', function () { const requestApproval = assert.doesNotReject( async () => { - perms = await mockRequestUserApproval(REQUEST_IDS.a) + perms = await requestUserApproval(REQUEST_IDS.a) }, 'should not reject single valid request', ) @@ -1065,14 +1058,14 @@ describe('permissions controller', function () { const approval1 = assert.doesNotReject( async () => { - perms1 = await mockRequestUserApproval(REQUEST_IDS.a) + perms1 = await requestUserApproval(REQUEST_IDS.a, DOMAINS.a.origin) }, 'should not reject request', ) const approval2 = assert.doesNotReject( async () => { - perms2 = await mockRequestUserApproval(REQUEST_IDS.b) + perms2 = await requestUserApproval(REQUEST_IDS.b, DOMAINS.b.origin) }, 'should not reject request', ) @@ -1105,13 +1098,11 @@ describe('permissions controller', function () { describe('rejectPermissionsRequest', function () { - let permController, mockRequestUserApproval + let permController, requestUserApproval beforeEach(async function () { permController = initPermController() - mockRequestUserApproval = getMockRequestUserApprovalFunction( - permController, - ) + requestUserApproval = getRequestUserApprovalHelper(permController) }) it('does nothing if called on non-existing request', async function () { @@ -1135,7 +1126,7 @@ describe('permissions controller', function () { it('rejects single existing request', async function () { const requestRejection = assert.rejects( - mockRequestUserApproval(REQUEST_IDS.a), + requestUserApproval(REQUEST_IDS.a), ERRORS.rejectPermissionsRequest.rejection(), 'should reject with expected error', ) @@ -1152,13 +1143,13 @@ describe('permissions controller', function () { it('rejects requests regardless of order', async function () { const requestRejection1 = assert.rejects( - mockRequestUserApproval(REQUEST_IDS.b), + requestUserApproval(REQUEST_IDS.b, DOMAINS.b.origin), ERRORS.rejectPermissionsRequest.rejection(), 'should reject with expected error', ) const requestRejection2 = assert.rejects( - mockRequestUserApproval(REQUEST_IDS.c), + requestUserApproval(REQUEST_IDS.c, DOMAINS.c.origin), ERRORS.rejectPermissionsRequest.rejection(), 'should reject with expected error', ) diff --git a/test/unit/app/controllers/permissions/permissions-middleware-test.js b/test/unit/app/controllers/permissions/permissions-middleware-test.js index b835ea8e8..8b56eb764 100644 --- a/test/unit/app/controllers/permissions/permissions-middleware-test.js +++ b/test/unit/app/controllers/permissions/permissions-middleware-test.js @@ -70,11 +70,15 @@ describe('permissions middleware', function () { ) const res = {} + const userApprovalPromise = getUserApprovalPromise(permController) + const pendingApproval = assert.doesNotReject( aMiddleware(req, res), 'should not reject permissions request', ) + await userApprovalPromise + assert.equal( permController.pendingApprovals.size, 1, 'perm controller should have single pending approval', @@ -131,11 +135,15 @@ describe('permissions middleware', function () { // send, approve, and validate first request // note use of ACCOUNTS.a.permitted + let userApprovalPromise = getUserApprovalPromise(permController) + const pendingApproval1 = assert.doesNotReject( aMiddleware(req1, res1), 'should not reject permissions request', ) + await userApprovalPromise + const id1 = permController.pendingApprovals.keys().next().value const approvedReq1 = PERMS.approvedRequest(id1, PERMS.requests.eth_accounts()) @@ -187,11 +195,15 @@ describe('permissions middleware', function () { // send, approve, and validate second request // note use of ACCOUNTS.b.permitted + userApprovalPromise = getUserApprovalPromise(permController) + const pendingApproval2 = assert.doesNotReject( aMiddleware(req2, res2), 'should not reject permissions request', ) + await userApprovalPromise + const id2 = permController.pendingApprovals.keys().next().value const approvedReq2 = PERMS.approvedRequest(id2, { ...requestedPerms2 }) @@ -251,12 +263,16 @@ describe('permissions middleware', function () { const expectedError = ERRORS.rejectPermissionsRequest.rejection() + const userApprovalPromise = getUserApprovalPromise(permController) + const requestRejection = assert.rejects( aMiddleware(req, res), expectedError, 'request should be rejected with correct error', ) + await userApprovalPromise + assert.equal( permController.pendingApprovals.size, 1, 'perm controller should have single pending approval', @@ -343,11 +359,15 @@ describe('permissions middleware', function () { ) const resA1 = {} + let userApprovalPromise = getUserApprovalPromise(permController) + const requestApproval1 = assert.doesNotReject( aMiddleware(reqA1, resA1), 'should not reject permissions request', ) + await userApprovalPromise + // create and start processing first request for second origin const reqB1 = RPC_REQUESTS.requestPermission( @@ -355,11 +375,15 @@ describe('permissions middleware', function () { ) const resB1 = {} + userApprovalPromise = getUserApprovalPromise(permController) + const requestApproval2 = assert.doesNotReject( bMiddleware(reqB1, resB1), 'should not reject permissions request', ) + await userApprovalPromise + assert.equal( permController.pendingApprovals.size, 2, 'perm controller should have expected number of pending approvals', @@ -373,12 +397,17 @@ describe('permissions middleware', function () { ) const resA2 = {} - await assert.rejects( + userApprovalPromise = getUserApprovalPromise(permController) + + const requestApprovalFail = assert.rejects( aMiddleware(reqA2, resA2), expectedError, 'request should be rejected with correct error', ) + await userApprovalPromise + await requestApprovalFail + assert.ok( ( !resA2.result && resA2.error && From 93f695d3c6c77ebd4afdfdf0327fc60c8df1a01d Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Sat, 25 Jul 2020 11:25:34 -0700 Subject: [PATCH 06/44] fix timing-reliant network controller test --- test/unit/app/controllers/network/network-controller-test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/app/controllers/network/network-controller-test.js b/test/unit/app/controllers/network/network-controller-test.js index 14d3bf31f..416274ab8 100644 --- a/test/unit/app/controllers/network/network-controller-test.js +++ b/test/unit/app/controllers/network/network-controller-test.js @@ -34,8 +34,10 @@ describe('NetworkController', function () { assert.equal(providerProxy.test, true) }) }) + describe('#getNetworkState', function () { it('should return loading when new', function () { + networkController = new NetworkController() const networkState = networkController.getNetworkState() assert.equal(networkState, 'loading', 'network is loading') }) From 30a59bb8674d1a1300cf8b6163457be3a7d7aa8e Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Mon, 27 Jul 2020 15:28:58 -0700 Subject: [PATCH 07/44] call initializeProvider where necessary --- test/unit/app/controllers/network/network-controller-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/app/controllers/network/network-controller-test.js b/test/unit/app/controllers/network/network-controller-test.js index 416274ab8..9c2aabc94 100644 --- a/test/unit/app/controllers/network/network-controller-test.js +++ b/test/unit/app/controllers/network/network-controller-test.js @@ -18,7 +18,6 @@ describe('NetworkController', function () { .reply(200) networkController = new NetworkController() - networkController.initializeProvider(networkControllerProviderConfig) }) afterEach(function () { @@ -37,7 +36,6 @@ describe('NetworkController', function () { describe('#getNetworkState', function () { it('should return loading when new', function () { - networkController = new NetworkController() const networkState = networkController.getNetworkState() assert.equal(networkState, 'loading', 'network is loading') }) @@ -53,11 +51,13 @@ describe('NetworkController', function () { describe('#setProviderType', function () { it('should update provider.type', function () { + networkController.initializeProvider(networkControllerProviderConfig) networkController.setProviderType('mainnet') const type = networkController.getProviderConfig().type assert.equal(type, 'mainnet', 'provider type is updated') }) it('should set the network to loading', function () { + networkController.initializeProvider(networkControllerProviderConfig) networkController.setProviderType('mainnet') const loading = networkController.isNetworkLoading() assert.ok(loading, 'network is loading') From 948a4c8316027de751844d4d96626cf7098705bd Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Mon, 27 Jul 2020 15:31:10 -0700 Subject: [PATCH 08/44] fixup! call initializeProvider where necessary --- test/unit/app/controllers/network/network-controller-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/app/controllers/network/network-controller-test.js b/test/unit/app/controllers/network/network-controller-test.js index 9c2aabc94..08164d99d 100644 --- a/test/unit/app/controllers/network/network-controller-test.js +++ b/test/unit/app/controllers/network/network-controller-test.js @@ -35,7 +35,7 @@ describe('NetworkController', function () { }) describe('#getNetworkState', function () { - it('should return loading when new', function () { + it('should return "loading" when new', function () { const networkState = networkController.getNetworkState() assert.equal(networkState, 'loading', 'network is loading') }) From 2880fe6a07b4d858d8cff9e387ef1c9956f2d151 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Tue, 28 Jul 2020 10:01:24 -0700 Subject: [PATCH 09/44] json-rpc-engine@5.2.0 (#9091) --- package.json | 2 +- yarn.lock | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a433b99cd..cafe5bc84 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "fuse.js": "^3.2.0", "human-standard-token-abi": "^2.0.0", "jazzicon": "^2.0.0", - "json-rpc-engine": "^5.1.8", + "json-rpc-engine": "^5.2.0", "json-rpc-middleware-stream": "^2.1.1", "jsonschema": "^1.2.4", "lodash": "^4.17.19", diff --git a/yarn.lock b/yarn.lock index 30f8e5ecf..83d52e6c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15765,6 +15765,14 @@ json-rpc-engine@^5.1.3, json-rpc-engine@^5.1.5, json-rpc-engine@^5.1.8: promise-to-callback "^1.0.0" safe-event-emitter "^1.0.1" +json-rpc-engine@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-5.2.0.tgz#0ea1162f56de53a41d47a4995168b56dc82bbf47" + integrity sha512-F9xjrIjMqPNCxzk9jtOgJMs9mt+80p03IbJALnO278grtSU+Sh/fSqb7gNk/gwlTxavO2+ABKenyz4ZP3kwKIQ== + dependencies: + eth-rpc-errors "^2.1.1" + safe-event-emitter "^1.0.1" + json-rpc-error@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" From f7c7007d8359bbbd114cee3d673767861ac34400 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 28 Jul 2020 16:09:20 -0300 Subject: [PATCH 10/44] Use development metametrics project during tests (#9093) e2e tests will now reference the development MetaMetrics project instead of the production one. The metrics endpoint should be stubbed out during e2e tests anyway, but this seemed like a better default regardless. --- ui/app/helpers/utils/metametrics.util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/helpers/utils/metametrics.util.js b/ui/app/helpers/utils/metametrics.util.js index f0ec22496..629dc2567 100644 --- a/ui/app/helpers/utils/metametrics.util.js +++ b/ui/app/helpers/utils/metametrics.util.js @@ -2,7 +2,7 @@ import ethUtil from 'ethereumjs-util' -const inDevelopment = process.env.NODE_ENV === 'development' +const inDevelopment = process.env.METAMASK_DEBUG || process.env.IN_TEST const METAMETRICS_BASE_URL = 'https://chromeextensionmm.innocraft.cloud/piwik.php' const METAMETRICS_REQUIRED_PARAMS = `?idsite=${inDevelopment ? 1 : 2}&rec=1&apiv=1` From 472b51059718d2281972993b2403f1dd66c26e28 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 28 Jul 2020 16:59:27 -0300 Subject: [PATCH 11/44] Use environment variable for MetaMetrics project ID (#9094) The MetaMetrics project ID can now be set via environment variable. It has not been set yet in practice, so for now the old project IDs will still be used. This is in preparation for migrating to a new project. --- development/build/scripts.js | 1 + ui/app/helpers/utils/metametrics.util.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index 0cb3e85ea..2ce9b86a0 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -334,6 +334,7 @@ function createScriptTasks ({ browserPlatforms, livereload }) { bundler.transform(envify({ METAMASK_DEBUG: opts.devMode, METAMASK_ENVIRONMENT: environment, + METAMETRICS_PROJECT_ID: process.env.METAMETRICS_PROJECT_ID, NODE_ENV: opts.devMode ? 'development' : 'production', IN_TEST: opts.testing ? 'true' : false, PUBNUB_SUB_KEY: process.env.PUBNUB_SUB_KEY || '', diff --git a/ui/app/helpers/utils/metametrics.util.js b/ui/app/helpers/utils/metametrics.util.js index 629dc2567..98b83f3d8 100644 --- a/ui/app/helpers/utils/metametrics.util.js +++ b/ui/app/helpers/utils/metametrics.util.js @@ -4,8 +4,13 @@ import ethUtil from 'ethereumjs-util' const inDevelopment = process.env.METAMASK_DEBUG || process.env.IN_TEST +let projectId = process.env.METAMETRICS_PROJECT_ID +if (!projectId) { + projectId = inDevelopment ? 1 : 2 +} + const METAMETRICS_BASE_URL = 'https://chromeextensionmm.innocraft.cloud/piwik.php' -const METAMETRICS_REQUIRED_PARAMS = `?idsite=${inDevelopment ? 1 : 2}&rec=1&apiv=1` +const METAMETRICS_REQUIRED_PARAMS = `?idsite=${projectId}&rec=1&apiv=1` const METAMETRICS_BASE_FULL = METAMETRICS_BASE_URL + METAMETRICS_REQUIRED_PARAMS const METAMETRICS_TRACKING_URL = inDevelopment From 0fb931950c11d54223c2e593d06561fe9596a2e6 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 28 Jul 2020 16:59:47 -0300 Subject: [PATCH 12/44] Disable Sentry in development (#9095) In a non-production environment, Sentry was configured to send error reports to a "test" MetaMask project. It will still do this during e2e tests, but in development Sentry is now disabled completely. In practice this was never useful in development. --- app/scripts/lib/setupSentry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 04c4b5014..9eca2ef5b 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -72,7 +72,9 @@ export const SENTRY_STATE = { export default function setupSentry ({ release, getState }) { let sentryTarget - if (METAMASK_DEBUG || process.env.IN_TEST) { + if (METAMASK_DEBUG) { + return + } else if (process.env.IN_TEST) { console.log(`Setting up Sentry Remote Error Reporting for '${METAMASK_ENVIRONMENT}': SENTRY_DSN_DEV`) sentryTarget = SENTRY_DSN_DEV } else { From 4ac6e82cb6b6b570f9cce32f449206243030b414 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Jul 2020 13:09:52 -0300 Subject: [PATCH 13/44] Only log error on first occurrence of missing substitution (#9096) A missing substitution for a localized message will now only log an error upon the first occurrence. Further errors are generally not useful. --- ui/app/helpers/utils/i18n-helper.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/app/helpers/utils/i18n-helper.js b/ui/app/helpers/utils/i18n-helper.js index a32120b4f..7fccc92cb 100644 --- a/ui/app/helpers/utils/i18n-helper.js +++ b/ui/app/helpers/utils/i18n-helper.js @@ -6,6 +6,7 @@ import * as Sentry from '@sentry/browser' const warned = {} const missingMessageErrors = {} +const missingSubstitutionErrors = {} /** * Returns a localized message for the given key @@ -55,7 +56,11 @@ export const getMessage = (localeCode, localeMessages, key, substitutions) => { return part } const substituteIndex = Number(subMatch[1]) - 1 - if (substitutions[substituteIndex] == null) { + if (substitutions[substituteIndex] == null && !missingSubstitutionErrors[localeCode]?.[key]) { + if (!missingSubstitutionErrors[localeCode]) { + missingSubstitutionErrors[localeCode] = {} + } + missingSubstitutionErrors[localeCode][key] = true const error = new Error(`Insufficient number of substitutions for message: '${phrase}'`) log.error(error) Sentry.captureException(error) From 0b71e1a619621077478ce8a3ad3f610d1494b33a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Jul 2020 13:14:08 -0300 Subject: [PATCH 14/44] Use environment variable for production Sentry DSN (#9097) The Sentry DSN is now expected to be provided via environment variable for production builds. The build script will fail if it is missing, and an error will be thrown at runtime if it is missing. The `SENTRY_DSN` environment variable has been set in CI to the old value for `SENTRY_PROD_DSN`. We can migrate to a new DSN at some point in the future. --- app/scripts/lib/setupSentry.js | 12 +++++++----- development/build/scripts.js | 5 +++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 9eca2ef5b..a6d1bb9b2 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -5,7 +5,6 @@ import extractEthjsErrorMessage from './extractEthjsErrorMessage' const METAMASK_DEBUG = process.env.METAMASK_DEBUG const METAMASK_ENVIRONMENT = process.env.METAMASK_ENVIRONMENT -const SENTRY_DSN_PROD = 'https://3567c198f8a8412082d32655da2961d0@sentry.io/273505' const SENTRY_DSN_DEV = 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496' // This describes the subset of Redux state attached to errors sent to Sentry @@ -74,12 +73,15 @@ export default function setupSentry ({ release, getState }) { if (METAMASK_DEBUG) { return - } else if (process.env.IN_TEST) { + } else if (METAMASK_ENVIRONMENT === 'production') { + if (!process.env.SENTRY_DSN) { + throw new Error(`Missing SENTRY_DSN environment variable in production environment`) + } + console.log(`Setting up Sentry Remote Error Reporting for '${METAMASK_ENVIRONMENT}': SENTRY_DSN`) + sentryTarget = process.env.SENTRY_DSN + } else { console.log(`Setting up Sentry Remote Error Reporting for '${METAMASK_ENVIRONMENT}': SENTRY_DSN_DEV`) sentryTarget = SENTRY_DSN_DEV - } else { - console.log(`Setting up Sentry Remote Error Reporting for '${METAMASK_ENVIRONMENT}': SENTRY_DSN_PROD`) - sentryTarget = SENTRY_DSN_PROD } Sentry.init({ diff --git a/development/build/scripts.js b/development/build/scripts.js index 2ce9b86a0..8a6b49111 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -330,6 +330,10 @@ function createScriptTasks ({ browserPlatforms, livereload }) { environment = 'other' } + if (environment === 'production' && !process.env.SENTRY_DSN) { + throw new Error('Missing SENTRY_DSN environment variable') + } + // Inject variables into bundle bundler.transform(envify({ METAMASK_DEBUG: opts.devMode, @@ -341,6 +345,7 @@ function createScriptTasks ({ browserPlatforms, livereload }) { PUBNUB_PUB_KEY: process.env.PUBNUB_PUB_KEY || '', ETH_GAS_STATION_API_KEY: process.env.ETH_GAS_STATION_API_KEY || '', CONF: opts.devMode ? conf : ({}), + SENTRY_DSN: process.env.SENTRY_DSN, }), { global: true, }) From 0da503954132639aaa74ea1a3d700093727a3123 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Wed, 29 Jul 2020 12:56:24 -0700 Subject: [PATCH 15/44] rpc-cap@3.1.0 (#9103) --- package.json | 2 +- yarn.lock | 83 +++++++++++++++++++++++----------------------------- 2 files changed, 38 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index cafe5bc84..f26a98e85 100644 --- a/package.json +++ b/package.json @@ -157,7 +157,7 @@ "redux": "^4.0.5", "redux-thunk": "^2.3.0", "reselect": "^3.0.1", - "rpc-cap": "^3.0.1", + "rpc-cap": "^3.1.0", "safe-event-emitter": "^1.0.1", "safe-json-stringify": "^1.2.0", "single-call-balance-checker-abi": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 83d52e6c2..eae41c1f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1714,6 +1714,34 @@ web3 "^0.20.7" web3-provider-engine "^15.0.4" +"@metamask/controllers@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-2.0.2.tgz#100a5d87b6061751b39edec2288f16f07d471e2d" + integrity sha512-KKxNguTEdkzwvfv2Hl4BE2OMGULLeh7df6iAwcEG8ipXWbTWGZsLr13DBrczQxRi8TiNPaksAakv++6sMu6ngA== + dependencies: + await-semaphore "^0.1.3" + eth-contract-metadata "^1.11.0" + eth-ens-namehash "^2.0.8" + eth-json-rpc-errors "^2.0.2" + eth-json-rpc-infura "^4.0.1" + eth-keyring-controller "^5.6.1" + eth-method-registry "1.1.0" + eth-phishing-detect "^1.1.13" + eth-query "^2.1.2" + eth-sig-util "^2.3.0" + ethereumjs-util "^6.1.0" + ethereumjs-wallet "0.6.0" + ethjs-query "^0.3.8" + human-standard-collectible-abi "^1.0.2" + human-standard-token-abi "^2.0.0" + isomorphic-fetch "^2.2.1" + jsonschema "^1.2.4" + percentile "^1.2.1" + single-call-balance-checker-abi "^1.0.0" + uuid "^3.3.2" + web3 "^0.20.7" + web3-provider-engine "^15.0.4" + "@metamask/eslint-config@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-1.1.0.tgz#03c6fbec8ba3d95fa017d8b98ab5d0701f7458a4" @@ -10116,7 +10144,7 @@ eth-json-rpc-middleware@^5.0.2: pify "^3.0.0" safe-event-emitter "^1.0.1" -eth-keyring-controller@^5.3.0, eth-keyring-controller@^5.6.1: +eth-keyring-controller@^5.6.1: version "5.6.1" resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-5.6.1.tgz#7b7268400704c8f5ce98a055910341177dd207ca" integrity sha512-sxJ87bJg7PvvPzj1sY1jJYHQL1HVUhh84Q/a4QPrcnzAAng1yibvvUfww0pCez4XJfHuMkJvUxfF8eAusJM8fQ== @@ -12040,34 +12068,6 @@ fuse.js@^3.4.6: resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.4.6.tgz#545c3411fed88bf2e27c457cab6e73e7af697a45" integrity sha512-H6aJY4UpLFwxj1+5nAvufom5b2BT2v45P1MkPvdGIK8fWjQx/7o6tTT1+ALV0yawQvbmvCF0ufl2et8eJ7v7Cg== -gaba@^1.9.3: - version "1.11.0" - resolved "https://registry.yarnpkg.com/gaba/-/gaba-1.11.0.tgz#7ff49cad2f2b95941222121a1984bb63783fe076" - integrity sha512-rQcLgR/FHQ8W6oNza/vxFnkbav0vgauBxm6LKqK6BkbjJGB979qoBRVja9fU/H5dUMiYmHJO9CrHjL0ofG/ukA== - dependencies: - await-semaphore "^0.1.3" - eth-contract-metadata "^1.11.0" - eth-ens-namehash "^2.0.8" - eth-json-rpc-errors "^2.0.2" - eth-json-rpc-infura "^4.0.1" - eth-keyring-controller "^5.3.0" - eth-method-registry "1.1.0" - eth-phishing-detect "^1.1.13" - eth-query "^2.1.2" - eth-sig-util "^2.3.0" - ethereumjs-util "^6.1.0" - ethereumjs-wallet "0.6.0" - ethjs-query "^0.3.8" - human-standard-collectible-abi "^1.0.2" - human-standard-token-abi "^2.0.0" - isomorphic-fetch "^2.2.1" - jsonschema "^1.2.4" - percentile "^1.2.1" - single-call-balance-checker-abi "^1.0.0" - uuid "^3.3.2" - web3 "^0.20.7" - web3-provider-engine "^15.0.4" - ganache-cli@^6.9.1: version "6.9.1" resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.9.1.tgz#1e13eee098fb9f19b031a191ec3f62ae926ea8b3" @@ -14046,11 +14046,6 @@ interpret@^2.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.0.0.tgz#b783ffac0b8371503e9ab39561df223286aa5433" integrity sha512-e0/LknJ8wpMMhTiWcjivB+ESwIuvHnBSlBbmP/pSb8CQJldoj1p2qv7xGZ/+BtbTziYRFSz8OsvdbiX45LtYQA== -intersect-objects@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/intersect-objects/-/intersect-objects-1.0.0.tgz#b7630d28994b89b0f04d44728106136549ce816e" - integrity sha512-MS1xypHKJhWopnJgn4IbitVvt2vFy2KjINQJAPhAtDejZ+ZbMDfyPc6JsS/mWFRt9Eoku4A4usE4f2loEOoeKQ== - into-stream@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" @@ -15755,7 +15750,7 @@ json-rpc-engine@^3.4.0, json-rpc-engine@^3.6.0: promise-to-callback "^1.0.0" safe-event-emitter "^1.0.1" -json-rpc-engine@^5.1.3, json-rpc-engine@^5.1.5, json-rpc-engine@^5.1.8: +json-rpc-engine@^5.1.3, json-rpc-engine@^5.1.5: version "5.1.8" resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-5.1.8.tgz#5ba0147ce571899bbaa7133ffbc05317c34a3c7f" integrity sha512-vTBSDEPJV1fPAsbm2g5sEuPjsgLdiab2f1CTn2PyRr8nxggUpA996PDlNQDsM0gnrA99F8KIBLq2nIKrOFl1Mg== @@ -23363,19 +23358,15 @@ rn-host-detect@^1.1.5: resolved "https://registry.yarnpkg.com/rn-host-detect/-/rn-host-detect-1.1.5.tgz#fbecb982b73932f34529e97932b9a63e58d8deb6" integrity sha512-ufk2dFT3QeP9HyZ/xTuMtW27KnFy815CYitJMqQm+pgG3ZAtHBsrU8nXizNKkqXGy3bQmhEoloVbrfbvMJMqkg== -rpc-cap@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/rpc-cap/-/rpc-cap-3.0.1.tgz#127fdc37563736f3e15c4550af31f6866490dd85" - integrity sha512-egeRnp+QVennA3obsOhVi/XhNSR4qQk8LHu0YFBiEpUHcm+68FqBkjvx0U/3CSXBmrRc8WRLo6kE3T64gWW02w== +rpc-cap@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/rpc-cap/-/rpc-cap-3.1.0.tgz#61ae8ca27c43da93f40972393ff34df1a28c3b5e" + integrity sha512-DyvT8xJEJVqdWP+fJ4VCI+q+sG30eOhAgaAczZ7/13ah8mtcl2pv4d5MffmTg8kJM4EId2eEExTVhBG8wgaomg== dependencies: - clone "^2.1.2" - eth-json-rpc-errors "^2.0.2" - fast-deep-equal "^2.0.1" - gaba "^1.9.3" - intersect-objects "^1.0.0" + "@metamask/controllers" "^2.0.2" + eth-rpc-errors "^2.1.1" is-subset "^0.1.1" - json-rpc-engine "^5.1.8" - obs-store "^4.0.3" + json-rpc-engine "^5.2.0" uuid "^3.3.2" rsa-pem-to-jwk@^1.1.3: From 5b39ce2822597fd8217c91c46fd6f80dea08f85a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 29 Jul 2020 17:31:01 -0300 Subject: [PATCH 16/44] Improve source maps (#9101) Our source maps were being corrupted during minification, because the `gulp-terser-js` plugin we were using didn't account for the existence of sourcemaps in the input. A configuration option to allow the input of sourcemaps was added in v5.2.0. The plugin has been updated, and we now use this option. Previously the generated sourcemaps had an invalid entry in the "sources" array, with the filename of the bundle itself. This was not a real source. After this change, this invalid source is no longer present. --- development/build/scripts.js | 3 +++ package.json | 2 +- yarn.lock | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index 8a6b49111..04f21aa76 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -206,6 +206,9 @@ function createScriptTasks ({ browserPlatforms, livereload }) { mangle: { reserved: [ 'MetamaskInpageProvider' ], }, + sourceMap: { + content: true, + }, })) } diff --git a/package.json b/package.json index f26a98e85..78e66b49b 100644 --- a/package.json +++ b/package.json @@ -236,7 +236,7 @@ "gulp-sass": "^4.0.0", "gulp-sourcemaps": "^2.6.0", "gulp-stylelint": "^13.0.0", - "gulp-terser-js": "^5.0.0", + "gulp-terser-js": "^5.2.2", "gulp-watch": "^5.0.1", "gulp-zip": "^4.0.0", "jsdom": "^11.2.0", diff --git a/yarn.lock b/yarn.lock index eae41c1f7..f1ffc3d0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12979,14 +12979,14 @@ gulp-stylelint@^13.0.0: strip-ansi "^6.0.0" through2 "^3.0.1" -gulp-terser-js@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/gulp-terser-js/-/gulp-terser-js-5.0.0.tgz#b570bb14e9c836aab78d633411073af0df8ca514" - integrity sha512-X5bduLqvRdX1RwUJmdm1J+HZu85gfIKkmDK95J6AAfXd4W/oYANt82gmIMZfhUGEmLm6e6xtKGsfTW6c0BRWnQ== +gulp-terser-js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/gulp-terser-js/-/gulp-terser-js-5.2.2.tgz#3d93db9b2b83f35dfcc5b209af6b1762756eb6a3" + integrity sha512-4ull0HzTWeWjRPiGmAFmdhRcEDOG+r7aXivNHOBQzElLzMaeVKQwmCPDi2juBzUUkjAkPkKb1jHVoJN/PKTvcA== dependencies: - object-assign "^4.1.1" plugin-error "^1.0.1" - terser "^4.1.4" + source-map "^0.7.3" + terser "^4.6.12" through2 "^3.0.1" vinyl-sourcemaps-apply "^0.2.1" @@ -25703,10 +25703,10 @@ terser@^4.1.2, terser@^4.4.3: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^4.1.4: - version "4.3.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.1.tgz#09820bcb3398299c4b48d9a86aefc65127d0ed65" - integrity sha512-pnzH6dnFEsR2aa2SJaKb1uSCl3QmIsJ8dEkj0Fky+2AwMMcC9doMqLOQIH6wVTEKaVfKVvLSk5qxPBEZT9mywg== +terser@^4.6.12: + version "4.8.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" + integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== dependencies: commander "^2.20.0" source-map "~0.6.1" From 10a12b8033ed6190548940240a7c4b3e3c9dd0fd Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 29 Jul 2020 16:05:19 -0500 Subject: [PATCH 17/44] update email us to contact us (#9104) --- app/_locales/am/messages.json | 3 --- app/_locales/ar/messages.json | 3 --- app/_locales/bg/messages.json | 3 --- app/_locales/bn/messages.json | 3 --- app/_locales/ca/messages.json | 3 --- app/_locales/cs/messages.json | 3 --- app/_locales/da/messages.json | 3 --- app/_locales/de/messages.json | 3 --- app/_locales/el/messages.json | 3 --- app/_locales/en/messages.json | 6 +++--- app/_locales/es/messages.json | 3 --- app/_locales/es_419/messages.json | 3 --- app/_locales/et/messages.json | 3 --- app/_locales/fa/messages.json | 3 --- app/_locales/fi/messages.json | 3 --- app/_locales/fil/messages.json | 3 --- app/_locales/fr/messages.json | 3 --- app/_locales/he/messages.json | 3 --- app/_locales/hi/messages.json | 3 --- app/_locales/hn/messages.json | 3 --- app/_locales/hr/messages.json | 3 --- app/_locales/ht/messages.json | 3 --- app/_locales/hu/messages.json | 3 --- app/_locales/id/messages.json | 3 --- app/_locales/it/messages.json | 3 --- app/_locales/kn/messages.json | 3 --- app/_locales/ko/messages.json | 3 --- app/_locales/lt/messages.json | 3 --- app/_locales/lv/messages.json | 3 --- app/_locales/ms/messages.json | 3 --- app/_locales/nl/messages.json | 3 --- app/_locales/no/messages.json | 3 --- app/_locales/pl/messages.json | 3 --- app/_locales/pt/messages.json | 3 --- app/_locales/pt_BR/messages.json | 3 --- app/_locales/ro/messages.json | 3 --- app/_locales/ru/messages.json | 3 --- app/_locales/sk/messages.json | 3 --- app/_locales/sl/messages.json | 3 --- app/_locales/sr/messages.json | 3 --- app/_locales/sv/messages.json | 3 --- app/_locales/sw/messages.json | 3 --- app/_locales/ta/messages.json | 3 --- app/_locales/th/messages.json | 3 --- app/_locales/tr/messages.json | 3 --- app/_locales/uk/messages.json | 3 --- app/_locales/zh_CN/messages.json | 3 --- app/_locales/zh_TW/messages.json | 3 --- ui/app/pages/settings/info-tab/info-tab.component.js | 4 ++-- 49 files changed, 5 insertions(+), 146 deletions(-) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index c279f5f17..c0ccc9352 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "ዕውቂያን አርትዕ" }, - "emailUs": { - "message": "ኢሜይል ያድርጉልን!" - }, "endOfFlowMessage1": { "message": "ፈተናውን አልፈዋል - የዘር ሐረግዎን ደህንነቱ በተጠበቀ መንገድ ያስቀምጡ፣ የእርስዎ ሃላፊነት ነው! " }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 46f240e2c..40815b680 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "تعديل جهة الاتصال" }, - "emailUs": { - "message": "راسلنا عبر البريد الإلكتروني!" - }, "endOfFlowMessage1": { "message": "لقد نجحت في الاختبار - احتفظ بعبارة الأمان الخاصة بك في مكان آمن، إنها مسؤوليتك!" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 668960321..21b285807 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Редактиране на контакт" }, - "emailUs": { - "message": "Изпратете ни имейл!" - }, "endOfFlowMessage1": { "message": "Преминахте теста - пазете основната си фраза на сигурно място, това е Ваша отговорност!" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 0b24f07a4..773217e6d 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "পরিচিতি সম্পাদনা করুন" }, - "emailUs": { - "message": "আমাদের ইমেল করুন!" - }, "endOfFlowMessage1": { "message": "আপনি টেস্টটি পাস করেছেন - আপনার সীডফ্রেজ নিরাপদে রাখুন, এটি আপনার দায়িত্ব!" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 1d5eed571..e948bc86e 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Editar Contacte" }, - "emailUs": { - "message": "Envia'ns un correu!" - }, "endOfFlowMessage1": { "message": "Has passat el test - mantingues la teva seedphrase segura, és la teva responsabilitat!" }, diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index cf2cb9b05..b1f50c457 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -148,9 +148,6 @@ "edit": { "message": "Upravit" }, - "emailUs": { - "message": "Napište nám e-mail!" - }, "enterPassword": { "message": "Zadejte heslo" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 136dd6a55..f6f6b0559 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Redigér Kontakt" }, - "emailUs": { - "message": "Send os en email!" - }, "endOfFlowMessage1": { "message": "Du bestod testen - pas godt på din seed-sætning, det er dit ansvar!" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 14192b687..cf8596b32 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -344,9 +344,6 @@ "editContact": { "message": "Kontakt bearbeiten" }, - "emailUs": { - "message": "Schreib uns eine Mail!" - }, "endOfFlowMessage1": { "message": "Sie haben den Test bestanden - bewahren Sie Ihre mnemonische Phrase sicher auf, Sie sind dafür verantwortlich! " }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 7d021f7ab..ca3af0a61 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Επεξεργασία Επαφής" }, - "emailUs": { - "message": "Στείλτε μας email!" - }, "endOfFlowMessage1": { "message": "Περάσατε τη δοκιμή - κρατήστε τη φράση φύτρου σας ασφαλή, είναι δική σας ευθύνη!" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index caa1e1fa2..797c8e709 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -409,6 +409,9 @@ "contactsSettingsDescription": { "message": "Add, edit, remove, and manage your contacts" }, + "contactUs": { + "message": "Contact us!" + }, "continueToWyre": { "message": "Continue to Wyre" }, @@ -535,9 +538,6 @@ "editPermission": { "message": "Edit Permission" }, - "emailUs": { - "message": "Email us!" - }, "endOfFlowMessage1": { "message": "You passed the test - keep your seedphrase safe, it's your responsibility!" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index d513a2f19..97576dba7 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -313,9 +313,6 @@ "editContact": { "message": "Editar Contacto" }, - "emailUs": { - "message": "¡Envíanos un correo!" - }, "endOfFlowMessage8": { "message": "MetaMask no puede recuperar tu seedphrase. Saber más." }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 8a83b65e8..a856b7e88 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Editar contacto" }, - "emailUs": { - "message": "¡Envíanos un correo electrónico!" - }, "endOfFlowMessage1": { "message": "Pasaste la prueba. Es responsabilidad tuya mantener la frase de inicialización segura." }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 5f1ca3132..28c7cb3b7 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Muuda kontakti" }, - "emailUs": { - "message": "Saatke meile e-kiri!" - }, "endOfFlowMessage1": { "message": "Läbisite kontrolli – hoidke seemnefraasi turvaliselt, see on teie vastutusel!" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index d59bb3f32..30bb2e2a4 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "ویرایش تماس" }, - "emailUs": { - "message": "به ما ایمیل کنید!" - }, "endOfFlowMessage1": { "message": "شما در امتحان موفق شدید - عبارت بازیابی را مصؤن نگهدارید، این مسؤلیت شماست!" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index a67ef40ea..62ac9fd9e 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Muokkaa yhteystietoa" }, - "emailUs": { - "message": "Lähetä meille sähköpostia!" - }, "endOfFlowMessage1": { "message": "Läpäisit kokeen – pidä salaustekstisi turvassa. Se on sinun vastuullasi!" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index d925e9f63..60ff2e03f 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -332,9 +332,6 @@ "editContact": { "message": "I-edit ang Contact" }, - "emailUs": { - "message": "Mag-email sa amin!" - }, "endOfFlowMessage1": { "message": "Pumasa ka sa test - panatilihing ligtas ang iyong seedphrase, responsibilidad mo ito!" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 7d28b3a0a..3b5e665cd 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -347,9 +347,6 @@ "editContact": { "message": "Modifier le contact" }, - "emailUs": { - "message": "Envoyez-nous un email !" - }, "endOfFlowMessage1": { "message": "Vous avez réussi l'essai : gardez votre phrase de départ en sécurité, c'est de votre responsabilité !" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 7fdd31a89..02c7a496c 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "ערוך איש קשר" }, - "emailUs": { - "message": "שלח/י לנו מייל!" - }, "endOfFlowMessage1": { "message": "עברת את הבחינה - יש לשמור את ה-seedphrase שלך במקום בטוח, זה באחריותך!" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 1686b79df..aad074d70 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "संपर्क संपादित करें" }, - "emailUs": { - "message": "हमें ईमेल करें!" - }, "endOfFlowMessage1": { "message": "आपने परीक्षा उत्तीर्ण कर ली - अपने बीज वाक्यांश को सुरक्षित रखें, यह आपकी जिम्मेदारी है!" }, diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 81d190e0d..bfc32cd4e 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -124,9 +124,6 @@ "edit": { "message": "संपादित करें" }, - "emailUs": { - "message": "हमें ईमेल करें!" - }, "enterPassword": { "message": "पासवर्ड दर्ज करें" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index bc4d39ff4..a818b79a6 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Uredi kontakt" }, - "emailUs": { - "message": "Pošaljite nam elektroničku poruku!" - }, "endOfFlowMessage1": { "message": "Prošli ste test – čuvajte svoju početnu rečenicu jer ste vi odgovorni za nju!" }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index c60e60c5a..6881d8a18 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -205,9 +205,6 @@ "edit": { "message": "Korije" }, - "emailUs": { - "message": "Imèl nou!" - }, "enterPassword": { "message": "Mete modpas" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 84be04277..73d19f975 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Kapcsolatok szerkesztése" }, - "emailUs": { - "message": "Írjon nekünk!" - }, "endOfFlowMessage1": { "message": "Átment a teszten - tartsa biztonságban a seed mondatot, ez az ön felelőssége!" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 7d942d231..267c5c079 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -350,9 +350,6 @@ "editContact": { "message": "Sunting Kontak" }, - "emailUs": { - "message": "Kirimkan kami email!" - }, "endOfFlowMessage1": { "message": "Anda lulus tes - jagalah agar frasa benih Anda aman, itu tanggung jawab Anda!" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index a1358dc74..62683c407 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -531,9 +531,6 @@ "editPermission": { "message": "Modifica Permessi" }, - "emailUs": { - "message": "Mandaci una mail!" - }, "endOfFlowMessage1": { "message": "Hai passato il test - tieni la tua frase seed al sicuro, è tua responsabilità!" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 7b8f6253f..207dccfb7 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "ಸಂಪರ್ಕವನ್ನು ಸಂಪಾದಿಸಿ" }, - "emailUs": { - "message": "ನಮಗೆ ಇಮೇಲ್ ಮಾಡಿ!" - }, "endOfFlowMessage1": { "message": "ನೀವು ಪರೀಕ್ಷೆಯನ್ನು ಪಾಸ್ ಮಾಡಿರುವಿರಿ - ನಿಮ್ಮ ಸೀಡ್‌ಫ್ರೇಸ್ ಸುರಕ್ಷಿತವಾಗಿರಿಸಿ, ಅದು ನಿಮ್ಮ ಜವಾಬ್ದಾರಿಯಾಗಿದೆ!" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 18f302c7d..8b73492f8 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "연락처 수정" }, - "emailUs": { - "message": "저자에게 메일 보내기!" - }, "endOfFlowMessage1": { "message": "인증을 통과했습니다 - 시드 구문을 안전하게 보관하세요. 그것은 당신의 의무입니다." }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 30fa9dd23..00d1cdb7e 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Taisyti kontaktą" }, - "emailUs": { - "message": "Rašykite mums el. paštu!" - }, "endOfFlowMessage1": { "message": "Jūs perėjote testą – laikykite saugiai savo atkūrimo frazę, tai jūsų atsakomybė!" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index f06839e6c..7d2906c49 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Rediģēt līgumu" }, - "emailUs": { - "message": "Raksiet mums e-pastu!" - }, "endOfFlowMessage1": { "message": "Jūs izgājāt pārbaudi — glabājiet atkopšanas frāzi drošībā, tā ir jūsu atbildība!" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 1cc5cd6bb..c4d2b538e 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -347,9 +347,6 @@ "editContact": { "message": "Edit Kenalan" }, - "emailUs": { - "message": "Hantarkan e-mel kepada kami!" - }, "endOfFlowMessage1": { "message": "Anda telah lulus ujian - simpan frasa benih anda di tempat yang selamat, itu tanggungjawab anda!" }, diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index 7d62e859a..ff4695c93 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -118,9 +118,6 @@ "edit": { "message": "Bewerk" }, - "emailUs": { - "message": "Email ons!" - }, "enterPassword": { "message": "Voer wachtwoord in" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index f4352505d..54d2319b9 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Rediger kontakt" }, - "emailUs": { - "message": "Send oss en e-post!" - }, "endOfFlowMessage1": { "message": "Du besto prøven - oppbevar den mnemoniske gjenopprettingsfrasen din på et sikkert sted, det er ditt ansvar! " }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index a3d06bba8..b057d1642 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Edytuj kontakt" }, - "emailUs": { - "message": "Napisz do nas!" - }, "endOfFlowMessage1": { "message": "Zaliczyłeś test – zabezpiecz swoją frazę seed, to Twoja odpowiedzialność!" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index cda66419d..c3e710345 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -124,9 +124,6 @@ "edit": { "message": "Editar" }, - "emailUs": { - "message": "Fale connosco!" - }, "enterPassword": { "message": "Introduza palavra-passe" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 4a5b2efbe..2eda26024 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -353,9 +353,6 @@ "editContact": { "message": "Editar Contato" }, - "emailUs": { - "message": "Escreva para nós!" - }, "endOfFlowMessage1": { "message": "Você passou no teste — mantenha sua frase semente segura, a responsabilidade é sua!" }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 40cc1f2d5..96e94f9f4 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Editați contact" }, - "emailUs": { - "message": "Trimiteți-ne un email!" - }, "endOfFlowMessage1": { "message": "Ați trecut testul – păstrați expresia sursă în siguranță, este răspunderea dvs.!" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 33d2e217e..24ea1aa24 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -154,9 +154,6 @@ "edit": { "message": "Редактировать" }, - "emailUs": { - "message": "Свяжитесь с нами по электронной почте!" - }, "enterPassword": { "message": "Введите пароль" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 940c816ec..285e4375d 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -350,9 +350,6 @@ "editContact": { "message": "Upraviť kontakt" }, - "emailUs": { - "message": "Napište nám e-mail!" - }, "endOfFlowMessage1": { "message": "Úspešne ste prešli testom – uchovávajte svoju seed frázu v bezpečí. Je to vaša zodpovednosť!" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index 84fda7bb1..c5659aaa6 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Uredi stik" }, - "emailUs": { - "message": "Pišite nam!" - }, "endOfFlowMessage1": { "message": "Opravili ste test - vaše geslo seed phrase je vaša odgovornost - skrbno pazite nanj!" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index fcbcb4cf9..468b55d6c 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "Izmeni kontakt" }, - "emailUs": { - "message": "Pošaljite nam e-poštu!" - }, "endOfFlowMessage1": { "message": "Prošli ste test - čuvajte svoju frazu početnih vrednosti, to je vaša odgovornost!" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 944b710f1..3cc07877f 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -353,9 +353,6 @@ "editContact": { "message": "Redigera kontakt" }, - "emailUs": { - "message": "Mejla oss!" - }, "endOfFlowMessage1": { "message": "Du klarade testet. Håll din seed phrase hemlig, den är på ditt ansvar!" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 77e7268b5..aa0c03cd9 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -353,9 +353,6 @@ "editContact": { "message": "Hariri Mawasiliano" }, - "emailUs": { - "message": "Tutumie barua pepe!" - }, "endOfFlowMessage1": { "message": "Umefaulu jaribio - weka kirai chako cha kuanzia mahali salama, ni wajibu wako!" }, diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index dfb39b6a3..fd849f557 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -139,9 +139,6 @@ "edit": { "message": "திருத்து" }, - "emailUs": { - "message": "எங்களுக்கு மின்னஞ்சல்!" - }, "enterPassword": { "message": "கடவுச்சொல்லை உள்ளிடவும்" }, diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 44bf097f0..eacf2f961 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -178,9 +178,6 @@ "editContact": { "message": "แก้ไขผู้ติดต่อ" }, - "emailUs": { - "message": "อีเมลหาเรา!" - }, "endOfFlowMessage1": { "message": "คุณผ่านการทดสอบแล้ว กรุณารับผิดชอบในการรักษา Seed Phrase ให้ปลอดภัย" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index c47144713..df904c9eb 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -151,9 +151,6 @@ "edit": { "message": "Düzenle" }, - "emailUs": { - "message": "Bize e-posta atın!" - }, "enterPassword": { "message": "Parolanızı girin" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index c9d389c78..14ff03db6 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "Редагувати контракт" }, - "emailUs": { - "message": "Напишіть нам!" - }, "endOfFlowMessage1": { "message": "Ви пройшли тест, зберігайте вашу початкову фразу в безпеці - це ваша відповідальність!" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 05566ca8e..bd13f3ac1 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -359,9 +359,6 @@ "editContact": { "message": "编辑联系人" }, - "emailUs": { - "message": "联系我们" - }, "endOfFlowMessage1": { "message": "您已通过测试 - 请妥善保管你的种子密语。这是您的责任!" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 532799252..3e2e5d834 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -356,9 +356,6 @@ "editContact": { "message": "編輯聯絡資訊" }, - "emailUs": { - "message": "寄 Email 給我們!" - }, "endOfFlowMessage1": { "message": "你通過測試了—安全存放助記詞,這是你的責任!" }, diff --git a/ui/app/pages/settings/info-tab/info-tab.component.js b/ui/app/pages/settings/info-tab/info-tab.component.js index c229f56b7..9d522a3a1 100644 --- a/ui/app/pages/settings/info-tab/info-tab.component.js +++ b/ui/app/pages/settings/info-tab/info-tab.component.js @@ -76,12 +76,12 @@ export default class InfoTab extends PureComponent { From 2445c0b41b13cc2a81baebb6e582d14d838f88cb Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 29 Jul 2020 19:39:47 -0230 Subject: [PATCH 18/44] Update dependencies (#9105) This change updates the following two dependencies to address high severity advisories in the production dependencies: * Use elliptic@6.5.3 * Use dot-prop@5.2.0 The public advisories: - `elliptic`: [npm](https://www.npmjs.com/advisories/1547) - `dot-prop`: [npm](https://www.npmjs.com/advisories/1213), [GHSA-ff7x-qrg7-qggm](https://github.com/advisories/GHSA-ff7x-qrg7-qggm) I don't believe there to be any functional changes here: - I don't think we hit any (important?) codepaths of the whole `ipld-zcash/zcash-bitcore-lib/elliptic` subtree of 3Box - `dot-prop` doesn't have a changelog but; - Looking through [`v3.0.0...v4.0.0`](https://github.com/sindresorhus/dot-prop/compare/v3.0.0...v4.0.0) it would seem that the breaking change was requiring Node.js 4 ([`88b6eb6`](https://github.com/sindresorhus/dot-prop/commit/88b6eb66cf4e119175a5ee7bf7faaec3ceb9497e)) - The only breaking change listed for [v5.0.0](https://github.com/sindresorhus/dot-prop/releases/tag/v5.0.0) was requiring Node.js 8. --- package.json | 3 +++ yarn.lock | 63 +++++++++++++--------------------------------------- 2 files changed, 18 insertions(+), 48 deletions(-) diff --git a/package.json b/package.json index 78e66b49b..ae5ba7ec1 100644 --- a/package.json +++ b/package.json @@ -52,10 +52,13 @@ "generate:migration": "./development/generate-migration.sh" }, "resolutions": { + "**/configstore/dot-prop": "^5.1.1", + "**/ethers/elliptic": "^6.5.3", "**/knex/minimist": "^1.2.5", "**/optimist/minimist": "^1.2.5", "**/socketcluster/minimist": "^1.2.5", "3box/ipfs/ipld-zcash/zcash-bitcore-lib/lodash": "^4.17.19", + "3box/ipfs/ipld-zcash/zcash-bitcore-lib/elliptic": "^6.5.3", "ganache-core/lodash": "^4.17.19" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index f1ffc3d0c..b34e2261c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5449,11 +5449,6 @@ bn.js@^1.0.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-1.3.0.tgz#0db4cbf96f8f23b742f5bcb9d1aa7a9994a05e83" integrity sha1-DbTL+W+PI7dC9by50ap6mZSgXoM= -bn.js@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-2.2.0.tgz#12162bc2ae71fc40a5626c33438f3a875cd37625" - integrity sha1-EhYrwq5x/EClYmwzQ486h1zTdiU= - body-parser@1.19.0, body-parser@^1.15.0, body-parser@^1.16.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -8880,12 +8875,12 @@ domutils@^1.7.0: dom-serializer "0" domelementtype "1" -dot-prop@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" - integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== +dot-prop@^4.1.0, dot-prop@^5.1.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb" + integrity sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A== dependencies: - is-obj "^1.0.0" + is-obj "^2.0.0" dotenv-defaults@^1.0.2: version "1.0.2" @@ -9081,43 +9076,10 @@ element-resize-detector@^1.2.1: dependencies: batch-processor "1.0.0" -elliptic@6.3.3: - version "6.3.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - inherits "^2.0.1" - -elliptic@=3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-3.0.3.tgz#865c9b420bfbe55006b9f969f97a0d2c44966595" - integrity sha1-hlybQgv75VAGuflp+XoNLESWZZU= - dependencies: - bn.js "^2.0.0" - brorand "^1.0.1" - hash.js "^1.0.0" - inherits "^2.0.1" - -elliptic@^6.0.0, elliptic@^6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - integrity sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8= - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -elliptic@^6.4.1: - version "6.5.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" - integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== +elliptic@6.3.3, elliptic@=3.0.3, elliptic@^6.0.0, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.3: + version "6.5.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -15059,11 +15021,16 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^1.0.0, is-obj@^1.0.1: +is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + is-object@^1.0.1, is-object@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" From a7089193c8c969ee581585cd08300c8b16bb8f73 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 29 Jul 2020 19:50:20 -0230 Subject: [PATCH 19/44] Use async/await for getRestrictedMethods (#9099) --- .../permissions/restrictedMethods.js | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/app/scripts/controllers/permissions/restrictedMethods.js b/app/scripts/controllers/permissions/restrictedMethods.js index 074cbb5a5..0e1ae4b9a 100644 --- a/app/scripts/controllers/permissions/restrictedMethods.js +++ b/app/scripts/controllers/permissions/restrictedMethods.js @@ -1,34 +1,30 @@ export default function getRestrictedMethods ({ getIdentities, getKeyringAccounts }) { return { 'eth_accounts': { - method: (_, res, __, end) => { - getKeyringAccounts() - .then((accounts) => { - const identities = getIdentities() - res.result = accounts - .sort((firstAddress, secondAddress) => { - if (!identities[firstAddress]) { - throw new Error(`Missing identity for address ${firstAddress}`) - } else if (!identities[secondAddress]) { - throw new Error(`Missing identity for address ${secondAddress}`) - } else if (identities[firstAddress].lastSelected === identities[secondAddress].lastSelected) { - return 0 - } else if (identities[firstAddress].lastSelected === undefined) { - return 1 - } else if (identities[secondAddress].lastSelected === undefined) { - return -1 - } + method: async (_, res, __, end) => { + try { + const accounts = await getKeyringAccounts() + const identities = getIdentities() + res.result = accounts.sort((firstAddress, secondAddress) => { + if (!identities[firstAddress]) { + throw new Error(`Missing identity for address ${firstAddress}`) + } else if (!identities[secondAddress]) { + throw new Error(`Missing identity for address ${secondAddress}`) + } else if (identities[firstAddress].lastSelected === identities[secondAddress].lastSelected) { + return 0 + } else if (identities[firstAddress].lastSelected === undefined) { + return 1 + } else if (identities[secondAddress].lastSelected === undefined) { + return -1 + } - return identities[secondAddress].lastSelected - identities[firstAddress].lastSelected - }) - end() + return identities[secondAddress].lastSelected - identities[firstAddress].lastSelected }) - .catch( - (err) => { - res.error = err - end(err) - }, - ) + end() + } catch (err) { + res.error = err + end(err) + } }, }, } From e43529107424363f2e6e8a1482fb1c44003f7f6d Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 29 Jul 2020 19:50:38 -0230 Subject: [PATCH 20/44] Use async/await for seedPhraseVerifier.verifyAccounts (#9100) --- app/scripts/lib/seed-phrase-verifier.js | 60 +++++++++++-------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/app/scripts/lib/seed-phrase-verifier.js b/app/scripts/lib/seed-phrase-verifier.js index 6a2925c71..f07e63a2c 100644 --- a/app/scripts/lib/seed-phrase-verifier.js +++ b/app/scripts/lib/seed-phrase-verifier.js @@ -16,41 +16,33 @@ const seedPhraseVerifier = { * @returns {Promise} - Promises undefined * */ - verifyAccounts (createdAccounts, seedWords) { - - return new Promise((resolve, reject) => { - - if (!createdAccounts || createdAccounts.length < 1) { - return reject(new Error('No created accounts defined.')) - } - - const keyringController = new KeyringController({}) - const Keyring = keyringController.getKeyringClassForType('HD Key Tree') - const opts = { - mnemonic: seedWords, - numberOfAccounts: createdAccounts.length, + async verifyAccounts (createdAccounts, seedWords) { + if (!createdAccounts || createdAccounts.length < 1) { + throw new Error('No created accounts defined.') + } + + const keyringController = new KeyringController({}) + const Keyring = keyringController.getKeyringClassForType('HD Key Tree') + const opts = { + mnemonic: seedWords, + numberOfAccounts: createdAccounts.length, + } + + const keyring = new Keyring(opts) + const restoredAccounts = await keyring.getAccounts() + log.debug('Created accounts: ' + JSON.stringify(createdAccounts)) + log.debug('Restored accounts: ' + JSON.stringify(restoredAccounts)) + + if (restoredAccounts.length !== createdAccounts.length) { + // this should not happen... + throw new Error('Wrong number of accounts') + } + + for (let i = 0; i < restoredAccounts.length; i++) { + if (restoredAccounts[i].toLowerCase() !== createdAccounts[i].toLowerCase()) { + throw new Error('Not identical accounts! Original: ' + createdAccounts[i] + ', Restored: ' + restoredAccounts[i]) } - - const keyring = new Keyring(opts) - keyring.getAccounts() - .then((restoredAccounts) => { - - log.debug('Created accounts: ' + JSON.stringify(createdAccounts)) - log.debug('Restored accounts: ' + JSON.stringify(restoredAccounts)) - - if (restoredAccounts.length !== createdAccounts.length) { - // this should not happen... - return reject(new Error('Wrong number of accounts')) - } - - for (let i = 0; i < restoredAccounts.length; i++) { - if (restoredAccounts[i].toLowerCase() !== createdAccounts[i].toLowerCase()) { - return reject(new Error('Not identical accounts! Original: ' + createdAccounts[i] + ', Restored: ' + restoredAccounts[i])) - } - } - return resolve() - }) - }) + } }, } From 95c2802bb025d2eef6354b11349e9c1ff4aeba92 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 13:55:56 -0300 Subject: [PATCH 21/44] Add `build-artifacts` to .gitignore (#9109) The `build-artifacts` directory is created on CI (as of #7151), and is used to store the sesify visualization and dependency logs. It's useful to have this ignored locally as well, for when those scripts are being tested. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 41575124b..6d11965cb 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ builds.zip test-artifacts test-builds +build-artifacts #ignore css output and sourcemaps ui/app/css/output/ From 5296a2a18b0ba5893fbe6e90f3c250d561b54255 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 14:43:02 -0300 Subject: [PATCH 22/44] Update `source-map-explorer` from v2.0.1 to v2.4.2 (#9110) The output remains identical between these two versions, and none of the changelog entries appear relevant to us (aside from maybe some of the bug fixes). --- package.json | 2 +- yarn.lock | 130 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 95 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index ae5ba7ec1..fa511502a 100644 --- a/package.json +++ b/package.json @@ -269,7 +269,7 @@ "sesify-viz": "^3.0.5", "sinon": "^9.0.0", "source-map": "^0.7.2", - "source-map-explorer": "^2.0.1", + "source-map-explorer": "^2.4.2", "string.prototype.matchall": "^4.0.2", "style-loader": "^0.21.0", "stylelint": "^13.6.1", diff --git a/yarn.lock b/yarn.lock index b34e2261c..c513bcb96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4110,6 +4110,11 @@ async.util.setimmediate@0.5.2: resolved "https://registry.yarnpkg.com/async.util.setimmediate/-/async.util.setimmediate-0.5.2.tgz#2812ebabf2a58027758d4bc7793d1ccfaf10255f" integrity sha1-KBLrq/KlgCd1jUvHeT0cz68QJV8= +async@0.9.x: + version "0.9.2" + resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" + integrity sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0= + async@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/async/-/async-2.0.0.tgz#d0900ad385af13804540a109c42166e3ae7b2b9d" @@ -7187,7 +7192,7 @@ convert-source-map@^0.3.3: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-0.3.5.tgz#f1d802950af7dd2631a1febe0596550c86ab3190" integrity sha1-8dgClQr33SYxof6+BZZVDIarMZA= -convert-source-map@^1.5.0, convert-source-map@^1.5.1, convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@^1.5.0, convert-source-map@^1.5.1, convert-source-map@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== @@ -9020,16 +9025,18 @@ ejs@^2.4.1: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.1.tgz#498ec0d495655abc6f23cd61868d926464071aa0" integrity sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ== -ejs@^2.6.2: - version "2.7.1" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.1.tgz#5b5ab57f718b79d4aca9254457afecd36fa80228" - integrity sha512-kS/gEPzZs3Y1rRsbGX4UOSjtP/CeJP0CxSNZHYxGfVM/VgLcv0ZqM7C45YyTj2DI2g7+P9Dd24C+IMIg6D0nYQ== - ejs@^2.7.4: version "2.7.4" resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== +ejs@^3.0.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.3.tgz#514d967a8894084d18d3d47bd169a1c0560f093d" + integrity sha512-wmtrUGyfSC23GC/B1SMv2ogAUgbQEtDmTIhfqielrG5ExIM9TP4UoYdi90jLF1aTcsWCJNEO0UrgKzP0y3nTSg== + dependencies: + jake "^10.6.1" + electron-download@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8" @@ -11431,6 +11438,13 @@ file-uri-to-path@1, file-uri-to-path@1.0.0: resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== +filelist@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.1.tgz#f10d1a3ae86c1694808e8f20906f43d4c9132dbb" + integrity sha512-8zSK6Nu0DQIC08mUC46sWGXi+q3GGpKydAG36k+JDba6VRpkevvOWUW5a/PhShij4+vHT9M+ghgG7eM+a9JDUQ== + dependencies: + minimatch "^3.0.4" + filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" @@ -13006,6 +13020,14 @@ gzip-size@5.0.0: duplexer "^0.1.1" pify "^3.0.0" +gzip-size@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" + integrity sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA== + dependencies: + duplexer "^0.1.1" + pify "^4.0.1" + hamt-sharding@~0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/hamt-sharding/-/hamt-sharding-0.0.2.tgz#53691f72122f1929a92a4688c7bb59545a8998ac" @@ -14783,6 +14805,11 @@ is-directory@^0.3.1: resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= +is-docker@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" + integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ== + is-dom@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/is-dom/-/is-dom-1.0.9.tgz#483832d52972073de12b9fe3f60320870da8370d" @@ -15296,10 +15323,12 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= -is-wsl@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d" - integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog== +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" is-yarn-global@^0.3.0: version "0.3.0" @@ -15475,6 +15504,16 @@ iterall@^1.1.3, iterall@^1.2.1: resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA== +jake@^10.6.1: + version "10.8.2" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" + integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== + dependencies: + async "0.9.x" + chalk "^2.4.2" + filelist "^1.0.1" + minimatch "^3.0.4" + java-properties@^0.2.9: version "0.2.10" resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-0.2.10.tgz#2551560c25fa1ad94d998218178f233ad9b18f60" @@ -19521,19 +19560,13 @@ only@~0.0.2: resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= -open@^6.3.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" - integrity sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg== - dependencies: - is-wsl "^1.1.0" - -open@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/open/-/open-7.0.0.tgz#7e52999b14eb73f90f0f0807fe93897c4ae73ec9" - integrity sha512-K6EKzYqnwQzk+/dzJAQSBORub3xlBTxMz+ntpZpH/LyCa1o6KjXhuN+2npAaI9jaSmU3R1Q8NWf4KUWcyytGsQ== +open@^7.0.0, open@^7.0.3: + version "7.1.0" + resolved "https://registry.yarnpkg.com/open/-/open-7.1.0.tgz#68865f7d3cb238520fa1225a63cf28bcf8368a1c" + integrity sha512-lLPI5KgOwEYCDKXf4np7y1PBEkj7HYIyP2DY8mVDRnx0VIIu6bNrRB0R66TuO7Mack6EnTNLm4uvcl1UoklTpA== dependencies: - is-wsl "^2.1.0" + is-docker "^2.0.0" + is-wsl "^2.1.1" opencollective-postinstall@^2.0.0: version "2.0.2" @@ -24380,22 +24413,23 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" integrity sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A== -source-map-explorer@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-map-explorer/-/source-map-explorer-2.0.1.tgz#988721e8320d7b6925bc40289e5de658fe4cad4d" - integrity sha512-mv2sv2b6oN2L9n18O/eLrYiP5zfWEHESLq4utWBqNw8GnkbuRuXs8twVCOhMT5hxRzfQgS7Yxh7HlQaW8oeiAQ== +source-map-explorer@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/source-map-explorer/-/source-map-explorer-2.4.2.tgz#fb23f86c3112eacde5683f24efaf4ddc9f677985" + integrity sha512-3ECQLffCFV8QgrTqcmddLkWL4/aQs6ljYfgWCLselo5QtizOfOeUCKnS4rFn7MIrdeZLM6TZrseOtsrWZhWKoQ== dependencies: btoa "^1.2.1" - chalk "^2.4.2" - convert-source-map "^1.6.0" - ejs "^2.6.2" + chalk "^3.0.0" + convert-source-map "^1.7.0" + ejs "^3.0.2" escape-html "^1.0.3" - glob "^7.1.4" - lodash "^4.17.11" - open "^6.3.0" + glob "^7.1.6" + gzip-size "^5.1.1" + lodash "^4.17.15" + open "^7.0.3" source-map "^0.7.3" - temp "^0.9.0" - yargs "^13.2.4" + temp "^0.9.1" + yargs "^15.3.1" source-map-resolve@^0.5.0, source-map-resolve@^0.5.1: version "0.5.1" @@ -25605,7 +25639,14 @@ temp-dir@^1.0.0: resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= -temp@^0.9.0, temp@~0.9.0: +temp@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.9.1.tgz#2d666114fafa26966cd4065996d7ceedd4dd4697" + integrity sha512-WMuOgiua1xb5R56lE0eH6ivpVmg/lq2OHm4+LtT/xtEtPQ+sz6N3bBM6WZ5FvO1lO4IKIOb43qnhoc4qxP5OeA== + dependencies: + rimraf "~2.6.2" + +temp@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/temp/-/temp-0.9.0.tgz#61391795a11bd9738d4c4d7f55f012cb8f55edaa" integrity sha512-YfUhPQCJoNQE5N+FJQcdPz63O3x3sdT4Xju69Gj4iZe0lBKOtnAMi0SLj9xKhGkcGhsxThvTJ/usxtFPo438zQ== @@ -28041,7 +28082,7 @@ yargs-parser@13.1.2, yargs-parser@^13.1.0, yargs-parser@^13.1.1, yargs-parser@^1 camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.1, yargs-parser@^18.1.3: +yargs-parser@^18.1.1, yargs-parser@^18.1.2, yargs-parser@^18.1.3: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== @@ -28163,6 +28204,23 @@ yargs@^15.0.0, yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.1" +yargs@^15.3.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + yargs@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" From fbd32c8920c7e54a1758769b203ebb80b70e0830 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 14:55:26 -0300 Subject: [PATCH 23/44] Update `gulp-rename` from v1.4.0 to v2.0.0 (#9112) The changes between these versions don't affect us. The breaking change was related to passing in a function to `gulp-rename`, which we don't do. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fa511502a..d6977899a 100644 --- a/package.json +++ b/package.json @@ -233,7 +233,7 @@ "gulp-imagemin": "^6.1.0", "gulp-livereload": "4.0.0", "gulp-multi-process": "^1.3.1", - "gulp-rename": "^1.4.0", + "gulp-rename": "^2.0.0", "gulp-replace": "^1.0.0", "gulp-rtlcss": "^1.4.0", "gulp-sass": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index c513bcb96..ab56ca74f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12888,10 +12888,10 @@ gulp-multi-process@^1.3.1: dependencies: async.queue "^0.5.2" -gulp-rename@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.4.0.tgz#de1c718e7c4095ae861f7296ef4f3248648240bd" - integrity sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg== +gulp-rename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-2.0.0.tgz#9bbc3962b0c0f52fc67cd5eaff6c223ec5b9cf6c" + integrity sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ== gulp-replace@^1.0.0: version "1.0.0" From 99e1ee40a48edc2d874a19c84f651175e24319ce Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 14:55:46 -0300 Subject: [PATCH 24/44] Update `sesify-viz` from v3.0.9 to v3.0.10 (#9111) The changes between v3.0.9 and v3.0.10 are minimial - just some minor improvements to error handling. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d6977899a..5215472a7 100644 --- a/package.json +++ b/package.json @@ -266,7 +266,7 @@ "selenium-webdriver": "^4.0.0-alpha.5", "serve-handler": "^6.1.2", "sesify": "^4.2.1", - "sesify-viz": "^3.0.5", + "sesify-viz": "^3.0.10", "sinon": "^9.0.0", "source-map": "^0.7.2", "source-map-explorer": "^2.4.2", diff --git a/yarn.lock b/yarn.lock index ab56ca74f..39aebf9e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23886,10 +23886,10 @@ sesify-tofu@^2.0.4: dependencies: acorn-globals "^4.3.3" -sesify-viz@^3.0.5: - version "3.0.9" - resolved "https://registry.yarnpkg.com/sesify-viz/-/sesify-viz-3.0.9.tgz#2fefff0456c3fa4e407e8564d2d0ab8797e29065" - integrity sha512-6weweTW6XQJyeoWK2vdoov52fpN07/lHqTlFwVO/M3LJMNr//BPfgxGxXVxtd09RdSLyAk5NZ7B3m3WgY8vMkQ== +sesify-viz@^3.0.10: + version "3.0.10" + resolved "https://registry.yarnpkg.com/sesify-viz/-/sesify-viz-3.0.10.tgz#1936e9a62bf8155c57dfc42e5eeceaa28b1cb875" + integrity sha512-Gamqr/8qbZDJ7Yq/NGUk3Iq2woTK67x1mZ59Qrt5ssLZZPzeCBYFeqnNWu8SUO42GlP1D3eyiGLHA31xceySHg== dependencies: ncp "^2.0.0" pify "^4.0.1" From 7ab01c8ffdd2645f350887cc2c2cd25d747affab Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 16:02:27 -0300 Subject: [PATCH 25/44] Update `browserify` from v16.2.3 to v16.5.1 (#9113) The changes between these two versions don't seen to affect us a great deal. The browserify dependency updates do result in changes to our production bundle, but the changes have no obvious functional impact. --- package.json | 2 +- yarn.lock | 53 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 5215472a7..63a41bb39 100644 --- a/package.json +++ b/package.json @@ -196,7 +196,7 @@ "babel-loader": "^8.0.6", "babelify": "^10.0.0", "brfs": "^1.6.1", - "browserify": "^16.2.3", + "browserify": "^16.5.1", "browserify-derequire": "^1.0.1", "browserify-transform-tools": "^1.7.0", "chai": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 39aebf9e2..3245b5190 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5734,17 +5734,17 @@ browserify-zlib@^0.2.0, browserify-zlib@~0.2.0: dependencies: pako "~1.0.5" -browserify@^16.1.0, browserify@^16.2.3: - version "16.2.3" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.2.3.tgz#7ee6e654ba4f92bce6ab3599c3485b1cc7a0ad0b" - integrity sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ== +browserify@^16.1.0, browserify@^16.5.1: + version "16.5.1" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.5.1.tgz#3c13c97436802930d5c3ae28658ddc33bfd37dc2" + integrity sha512-EQX0h59Pp+0GtSRb5rL6OTfrttlzv+uyaUVlK6GX3w11SQ0jKPKyjC/54RhPR2ib2KmfcELM06e8FxcI5XNU2A== dependencies: JSONStream "^1.0.3" assert "^1.4.0" browser-pack "^6.0.1" browser-resolve "^1.11.0" browserify-zlib "~0.2.0" - buffer "^5.0.2" + buffer "~5.2.1" cached-path-relative "^1.0.0" concat-stream "^1.6.0" console-browserify "^1.1.0" @@ -5762,7 +5762,7 @@ browserify@^16.1.0, browserify@^16.2.3: inherits "~2.0.1" insert-module-globals "^7.0.0" labeled-stream-splicer "^2.0.0" - mkdirp "^0.5.0" + mkdirp-classic "^0.5.2" module-deps "^6.0.0" os-browserify "~0.3.0" parents "^1.0.1" @@ -5776,7 +5776,7 @@ browserify@^16.1.0, browserify@^16.2.3: shasum "^1.0.0" shell-quote "^1.6.1" stream-browserify "^2.0.0" - stream-http "^2.0.0" + stream-http "^3.0.0" string_decoder "^1.1.1" subarg "^1.0.0" syntax-error "^1.1.1" @@ -5964,7 +5964,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.0.2, buffer@^5.0.5: +buffer@^5.0.5, buffer@~5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== @@ -18249,6 +18249,11 @@ mixin-object@^2.0.1: for-in "^0.1.3" is-extendable "^0.1.1" +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" @@ -22448,15 +22453,6 @@ readable-stream@1.1, readable-stream@1.1.x, readable-stream@^1.0.33, readable-st isarray "0.0.1" string_decoder "~0.10.x" -"readable-stream@2 || 3", readable-stream@^3.0.0, readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.0.5, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" - integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.5, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -22470,6 +22466,15 @@ readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.8, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +"readable-stream@2 || 3", readable-stream@^3.0.0, readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.0.5, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@~1.0.15: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" @@ -24803,7 +24808,7 @@ stream-exhaust@^1.0.1: resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== -stream-http@^2.0.0, stream-http@^2.7.2: +stream-http@^2.7.2: version "2.7.2" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" integrity sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw== @@ -24814,6 +24819,16 @@ stream-http@^2.0.0, stream-http@^2.7.2: to-arraybuffer "^1.0.0" xtend "^4.0.0" +stream-http@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.1.1.tgz#0370a8017cf8d050b9a8554afe608f043eaff564" + integrity sha512-S7OqaYu0EkFpgeGFb/NPOoPLxFko7TPqtEeFg5DXPB4v/KETHG0Ln6fRFrNezoelpaDKmycEmmZ81cC9DAwgYg== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.4" + readable-stream "^3.6.0" + xtend "^4.0.2" + stream-parser@~0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/stream-parser/-/stream-parser-0.3.1.tgz#1618548694420021a1182ff0af1911c129761773" @@ -28015,7 +28030,7 @@ xregexp@2.0.0: resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= -xtend@^4.0.0, xtend@~4.0.0: +xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== From d4c3fa6885637f783de7e1d462cd3946ef3d71a3 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 16:19:42 -0300 Subject: [PATCH 26/44] Factor out `getEnvironment` function in build script (#9114) There are no functional changes. This was extracted from #8170 --- development/build/scripts.js | 37 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index 04f21aa76..6f206ee57 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -316,23 +316,7 @@ function createScriptTasks ({ browserPlatforms, livereload }) { bundler = bundler.external(opts.externalDependencies) } - let environment - if (opts.devMode) { - environment = 'development' - } else if (opts.testing) { - environment = 'testing' - } else if (process.env.CIRCLE_BRANCH === 'master') { - environment = 'production' - } else if (/^Version-v(\d+)[.](\d+)[.](\d+)/.test(process.env.CIRCLE_BRANCH)) { - environment = 'release-candidate' - } else if (process.env.CIRCLE_BRANCH === 'develop') { - environment = 'staging' - } else if (process.env.CIRCLE_PULL_REQUEST) { - environment = 'pull-request' - } else { - environment = 'other' - } - + const environment = getEnvironment({ devMode: opts.devMode, test: opts.testing }) if (environment === 'production' && !process.env.SENTRY_DSN) { throw new Error('Missing SENTRY_DSN environment variable') } @@ -372,3 +356,22 @@ function createScriptTasks ({ browserPlatforms, livereload }) { function beep () { process.stdout.write('\x07') } + +function getEnvironment ({ devMode, test }) { + // get environment slug + if (devMode) { + return 'development' + } else if (test) { + return 'testing' + } else if (process.env.CIRCLE_BRANCH === 'master') { + return 'production' + } else if (/^Version-v(\d+)[.](\d+)[.](\d+)/.test(process.env.CIRCLE_BRANCH)) { + return 'release-candidate' + } else if (process.env.CIRCLE_BRANCH === 'develop') { + return 'staging' + } else if (process.env.CIRCLE_PULL_REQUEST) { + return 'pull-request' + } else { + return 'other' + } +} From 6fe3a1179b878f69416126194d42975434267f07 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 30 Jul 2020 17:44:13 -0300 Subject: [PATCH 27/44] Update `brfs` from v1.6.1 to v2.0.2 (#9115) We were not affected by the breaking changes introduced with v2.0.0. This was updated primarily to get a bugfix relating to source maps, and to update some older transitive dependencies. --- package.json | 2 +- yarn.lock | 157 +++++++++++++++++++++++++-------------------------- 2 files changed, 79 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index 63a41bb39..25634fed1 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "babel-eslint": "^10.1.0", "babel-loader": "^8.0.6", "babelify": "^10.0.0", - "brfs": "^1.6.1", + "brfs": "^2.0.2", "browserify": "^16.5.1", "browserify-derequire": "^1.0.1", "browserify-transform-tools": "^1.7.0", diff --git a/yarn.lock b/yarn.lock index 3245b5190..885354726 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3748,6 +3748,11 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= +array-from@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/array-from/-/array-from-2.1.1.tgz#cfe9d8c26628b9dc5aecc62a9f5d8f1f352c1195" + integrity sha1-z+nYwmYoudxa7MYqn12PHzUsEZU= + array-includes@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" @@ -5584,14 +5589,14 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brfs@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/brfs/-/brfs-1.6.1.tgz#b78ce2336d818e25eea04a0947cba6d4fb8849c3" - integrity sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ== +brfs@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/brfs/-/brfs-2.0.2.tgz#44237878fa82aa479ce4f5fe2c1796ec69f07845" + integrity sha512-IrFjVtwu4eTJZyu8w/V2gxU7iLTtcHih67sgEdzrhjLBMHp2uYefUBfdM4k2UvcuWMgV7PQDZHSLeNWnLFKWVQ== dependencies: quote-stream "^1.0.1" resolve "^1.1.5" - static-module "^2.2.0" + static-module "^3.0.2" through2 "^2.0.0" brorand@^1.0.1: @@ -8002,6 +8007,11 @@ d@^1.0.1: es5-ext "^0.10.50" type "^1.0.1" +dash-ast@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" + integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -9484,7 +9494,7 @@ es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: es5-ext "^0.10.35" es6-symbol "^3.1.1" -es6-map@^0.1.3: +es6-map@^0.1.3, es6-map@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= @@ -9513,7 +9523,7 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -es6-set@~0.1.5: +es6-set@^0.1.5, es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= @@ -9570,34 +9580,10 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@1.x.x, escodegen@^1.8.1, escodegen@~1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" - integrity sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -escodegen@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852" - integrity sha512-v0MYvNQ32bzwoG2OSFzWAkuahDQHK92JBN0pTAALJ4RIxEZe766QJPDR8Hqy7XNUy5K3fnVL76OqYAdc4TZEIw== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.5.6" - -escodegen@^1.9.1: - version "1.13.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.13.0.tgz#c7adf9bd3f3cc675bb752f202f79a720189cab29" - integrity sha512-eYk2dCkxR07DsHA/X2hRBj0CFAZeri/LyDMc0C8JT1Hqi6JnVpMhJ7XFITbb0+yZS3lVkaPL2oCkZ3AVmeVbMw== +escodegen@1.x.x, escodegen@^1.11.1, escodegen@^1.9.0, escodegen@^1.9.1: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== dependencies: esprima "^4.0.1" estraverse "^4.2.0" @@ -9902,7 +9888,7 @@ espree@^6.1.2: acorn-jsx "^5.2.0" eslint-visitor-keys "^1.1.0" -esprima@3.x.x, esprima@^3.1.3: +esprima@3.x.x: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= @@ -9937,6 +9923,11 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= +estree-is-function@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/estree-is-function/-/estree-is-function-1.0.0.tgz#c0adc29806d7f18a74db7df0f3b2666702e37ad2" + integrity sha512-nSCWn1jkSq2QAtkaVLJZY2ezwcFO161HVc174zL1KPW3RJ+O6C3eJb8Nx7OXzvhoEv+nLgSR1g71oWUHUDTrJA== + esutils@^2.0.0, esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -11154,7 +11145,7 @@ fake-tag@^1.0.0: resolved "https://registry.yarnpkg.com/fake-tag/-/fake-tag-1.0.1.tgz#1d59da482240a02bd83500ca98976530ed154b0d" integrity sha512-qmewZoBpa71mM+y6oxXYW/d1xOYQmeIvnEXAt1oCmdP0sqcogWYLepR87QL1jQVLSVMVYDq2cjY6ec/Wu8/4pg== -falafel@^2.0.0, falafel@^2.1.0: +falafel@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c" integrity sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw= @@ -12151,7 +12142,7 @@ gensync@^1.0.0-beta.1: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== -get-assigned-identifiers@^1.2.0: +get-assigned-identifiers@^1.1.0, get-assigned-identifiers@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz#6dbf411de648cbaf8d9169ebb0d2d576191e2ff1" integrity sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ== @@ -17583,12 +17574,12 @@ mafmt@^6.0.0, mafmt@^6.0.2, mafmt@^6.0.4, mafmt@^6.0.7: dependencies: multiaddr "^6.0.4" -magic-string@^0.22.4: - version "0.22.5" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" - integrity sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w== +magic-string@0.25.1: + version "0.25.1" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e" + integrity sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg== dependencies: - vlq "^0.2.2" + sourcemap-codec "^1.4.1" make-dir@^1.0.0, make-dir@^1.2.0: version "1.3.0" @@ -19299,11 +19290,6 @@ object-inspect@~1.3.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.3.0.tgz#5b1eb8e6742e2ee83342a637034d844928ba2f6d" integrity sha512-OHHnLgLNXpM++GnJRyyhbr2bwl3pPVm4YvaraHrRvDt/N3r+s/gDVHciA7EJBTkijKXj61ssgSAikq1fb0IBRg== -object-inspect@~1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.4.1.tgz#37ffb10e71adaf3748d05f713b4c9452f402cbc4" - integrity sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw== - object-is@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" @@ -21732,7 +21718,7 @@ quick-lru@^4.0.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== -quote-stream@^1.0.1, quote-stream@~1.0.2: +quote-stream@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-1.0.2.tgz#84963f8c9c26b942e153feeb53aae74652b7e0b2" integrity sha1-hJY/jJwmuULhU/7rU6rnRlK34LI= @@ -22453,6 +22439,15 @@ readable-stream@1.1, readable-stream@1.1.x, readable-stream@^1.0.33, readable-st isarray "0.0.1" string_decoder "~0.10.x" +"readable-stream@2 || 3", readable-stream@^3.0.0, readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.0.5, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.5, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -22466,15 +22461,6 @@ readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.8, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.0.0, readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.0.5, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readable-stream@~1.0.15: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" @@ -23653,6 +23639,19 @@ schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6 ajv "^6.10.2" ajv-keywords "^3.4.1" +scope-analyzer@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/scope-analyzer/-/scope-analyzer-2.1.1.tgz#5156c27de084d74bf75af9e9506aaf95c6e73dd6" + integrity sha512-azEAihtQ9mEyZGhfgTJy3IbOWEzeOrYbg7NcYEshPKnKd+LZmC3TNd5dmDxbLBsTG/JVWmCp+vDJ03vJjeXMHg== + dependencies: + array-from "^2.1.1" + dash-ast "^1.0.0" + es6-map "^0.1.5" + es6-set "^0.1.5" + es6-symbol "^3.1.1" + estree-is-function "^1.0.0" + get-assigned-identifiers "^1.1.0" + scrollbarwidth@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/scrollbarwidth/-/scrollbarwidth-0.1.3.tgz#1b0de64e288c38c427f4a01fe00a462a04b94fdf" @@ -24494,7 +24493,7 @@ source-map@^0.4.2: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.3, source-map@~0.5.6: +source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -24504,6 +24503,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +sourcemap-codec@^1.4.1: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + space-separated-tokens@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.4.tgz#27910835ae00d0adfcdbd0ad7e611fb9544351fa" @@ -24676,12 +24680,12 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.2.tgz#75e93a61944116b4959d665c8db2d243631d6ddc" integrity sha512-8LpelPGR0qQM4PnfLiplOQNJcIN1/r2Gy0xKB2zKnIW2YzPMt2sR4I/+gtPjhN7Svh9kw+zqEg2SFwpBO9iNiw== -static-eval@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz#2d1759306b1befa688938454c546b7871f806a42" - integrity sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== +static-eval@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.1.0.tgz#a16dbe54522d7fa5ef1389129d813fd47b148014" + integrity sha512-agtxZ/kWSsCkI5E4QifRwsaPs0P0JmZV6dkLz6ILYfFYQGn+5plctanRN+IC8dJRiFkyXHrwEE3W9Wmx67uDbw== dependencies: - escodegen "^1.8.1" + escodegen "^1.11.1" static-extend@^0.1.1: version "0.1.2" @@ -24691,24 +24695,24 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-module@^2.2.0: - version "2.2.5" - resolved "https://registry.yarnpkg.com/static-module/-/static-module-2.2.5.tgz#bd40abceae33da6b7afb84a0e4329ff8852bfbbf" - integrity sha512-D8vv82E/Kpmz3TXHKG8PPsCPg+RAX6cbCOyvjM6x04qZtQ47EtJFVwRsdov3n5d6/6ynrOY9XB4JkaZwB2xoRQ== +static-module@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/static-module/-/static-module-3.0.4.tgz#bfbd1d1c38dd1fbbf0bb4af0c1b3ae18a93a2b68" + integrity sha512-gb0v0rrgpBkifXCa3yZXxqVmXDVE+ETXj6YlC/jt5VzOnGXR2C15+++eXuMDUYsePnbhf+lwW0pE1UXyOLtGCw== dependencies: + acorn-node "^1.3.0" concat-stream "~1.6.0" convert-source-map "^1.5.1" duplexer2 "~0.1.4" - escodegen "~1.9.0" - falafel "^2.1.0" + escodegen "^1.11.1" has "^1.0.1" - magic-string "^0.22.4" + magic-string "0.25.1" merge-source-map "1.0.4" - object-inspect "~1.4.0" - quote-stream "~1.0.2" + object-inspect "^1.6.0" readable-stream "~2.3.3" + scope-analyzer "^2.0.1" shallow-copy "~0.0.1" - static-eval "^2.0.0" + static-eval "^2.0.5" through2 "~2.0.3" "statuses@>= 1.3.1 < 2": @@ -27121,11 +27125,6 @@ vinyl@^2.2.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vlq@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" - integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== - vm-browserify@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" From 3f59b648c8cd796cd19bd8dd29f980c05c810172 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 4 Aug 2020 12:09:02 -0300 Subject: [PATCH 28/44] Non-zero exit code upon failure to validate source maps (#9132) The source map validator will now exit with a non-zero exit code when an error occurs, or when the source maps cannot be validated. --- development/sourcemap-validator.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index e87c0604f..2fda2a114 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -13,13 +13,23 @@ const fsAsync = pify(fs) // if not working it may error or print minified garbage // -start().catch(console.error) +start().catch((error) => { + console.error(error) + process.exit(1) +}) async function start () { const targetFiles = [`inpage.js`, `contentscript.js`, `ui.js`, `background.js`] + let valid = true + for (const buildName of targetFiles) { - await validateSourcemapForFile({ buildName }) + const fileIsValid = await validateSourcemapForFile({ buildName }) + valid = valid && fileIsValid + } + + if (!valid) { + process.exit(1) } } @@ -59,6 +69,7 @@ async function validateSourcemapForFile ({ buildName }) { console.log(` sampling from ${consumer.sources.length} files`) let sampleCount = 0 + let valid = true const buildLines = rawBuild.split('\n') const targetString = 'new Error' @@ -71,6 +82,7 @@ async function validateSourcemapForFile ({ buildName }) { const result = consumer.originalPositionFor(position) // warn if source content is missing if (!result.source) { + valid = false console.warn(`!! missing source for position: ${JSON.stringify(position)}`) // const buildLine = buildLines[position.line - 1] console.warn(` origin in build:`) @@ -86,6 +98,7 @@ async function validateSourcemapForFile ({ buildName }) { const portion = line.slice(result.column) const isMaybeValid = portion.includes(targetString) if (!isMaybeValid) { + valid = false console.error('Sourcemap seems invalid:') console.log(`\n========================== ${result.source} ====================================\n`) console.log(line) @@ -94,6 +107,7 @@ async function validateSourcemapForFile ({ buildName }) { }) }) console.log(` checked ${sampleCount} samples`) + return valid } function indicesOf (substring, string) { From c5ce4a1ccdbc0b651ad4968ba45a817097d3a9ca Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 4 Aug 2020 12:10:28 -0300 Subject: [PATCH 29/44] Add `validate-source-maps` npm script (#9134) This script executes the `sourcemap-validator.js` script to validate the source maps in the `dist` directory. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 25634fed1..578574cb9 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "lint:shellcheck": "./development/shellcheck.sh", "lint:styles": "stylelint '*/**/*.scss'", "lint:lockfile": "lockfile-lint --path yarn.lock --allowed-hosts npm yarn github.com codeload.github.com --empty-hostname false --allowed-schemes \"https:\" \"git+https:\"", + "validate-source-maps": "node ./development/sourcemap-validator.js", "verify-locales": "node ./development/verify-locale-strings.js", "verify-locales:fix": "node ./development/verify-locale-strings.js --fix", "mozilla-lint": "addons-linter dist/firefox", From e17c18ff7d9dbd8f5e8b06cefff3f8f2dabbb503 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 4 Aug 2020 12:55:11 -0300 Subject: [PATCH 30/44] Improve sourcemap validator console report (#9131) The report printed to the console for invalid source map samples has been improved in a few ways: * The entire message is now printed using `console.error`, so the contents aren't split between STDERR and STDOUT * The code fence is now guaranteed to be a set length, rather than it varying depending on the filename * The code fence is no longer padded on the inside with newlines, which results in a more compact output that is (in my opinion) just as readable. --- development/sourcemap-validator.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index 2fda2a114..d4d9b8293 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -99,10 +99,7 @@ async function validateSourcemapForFile ({ buildName }) { const isMaybeValid = portion.includes(targetString) if (!isMaybeValid) { valid = false - console.error('Sourcemap seems invalid:') - console.log(`\n========================== ${result.source} ====================================\n`) - console.log(line) - console.log(`\n==============================================================================\n`) + console.error(`Sourcemap seems invalid:\n${getFencedCode(result.source, line)}`) } }) }) @@ -110,6 +107,20 @@ async function validateSourcemapForFile ({ buildName }) { return valid } +const CODE_FENCE_LENGTH = 80 +const TITLE_PADDING_LENGTH = 1 + +function getFencedCode (filename, code) { + const title = `${' '.repeat(TITLE_PADDING_LENGTH)}${filename}${' '.repeat(TITLE_PADDING_LENGTH)}` + const openingFenceLength = Math.max(CODE_FENCE_LENGTH - (filename.length + (TITLE_PADDING_LENGTH * 2)), 0) + const startOpeningFenceLength = Math.floor(openingFenceLength / 2) + const endOpeningFenceLength = Math.ceil(openingFenceLength / 2) + const openingFence = `${'='.repeat(startOpeningFenceLength)}${title}${'='.repeat(endOpeningFenceLength)}` + const closingFence = '='.repeat(CODE_FENCE_LENGTH) + + return `${openingFence}\n${code}\n${closingFence}\n` +} + function indicesOf (substring, string) { const a = [] let i = -1 From b490da39310c33333c58967a114e0a8929eb52c0 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 4 Aug 2020 13:45:03 -0300 Subject: [PATCH 31/44] Update source map validator target files (#9133) All JavaScript files included in the final bundle are now listed as target files. The `phishing-detect.js` file is the only new file to be validated that was not validated before. Any files that are expected to fail validation are commented out, with a note explaining why they're expected to fail. --- development/sourcemap-validator.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index d4d9b8293..7be473110 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -20,7 +20,15 @@ start().catch((error) => { async function start () { - const targetFiles = [`inpage.js`, `contentscript.js`, `ui.js`, `background.js`] + const targetFiles = [ + `background.js`, + // `bg-libs`, skipped because source maps are invalid due to browserify bug: https://github.com/browserify/browserify/issues/1971 + // `contentscript.js`, skipped because the validator is erroneously sampling the inlined `inpage.js` script + `inpage.js`, + 'phishing-detect.js', + `ui.js`, + // `ui-libs.js`, skipped because source maps are invalid due to browserify bug: https://github.com/browserify/browserify/issues/1971 + ] let valid = true for (const buildName of targetFiles) { From 041b5e595aaef011466fbc511bf0e3c52a256f6c Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 4 Aug 2020 14:21:46 -0300 Subject: [PATCH 32/44] Add source map validator to CI (#9135) Source maps are now validated during CI. This is done during a new job called "validate-source-maps`, and it is required to pass for tests to pass. --- .circleci/config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 240b4aa02..d4b0febd7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,9 @@ workflows: - test-unit-global: requires: - prep-deps + - validate-source-maps: + requires: + - prep-build - test-mozilla-lint: requires: - prep-deps @@ -49,6 +52,7 @@ workflows: - test-lint-lockfile - test-unit - test-unit-global + - validate-source-maps - test-mozilla-lint - test-e2e-chrome - test-e2e-firefox @@ -358,6 +362,18 @@ jobs: - run: name: test:unit:global command: yarn test:unit:global + + validate-source-maps: + docker: + - image: circleci/node@sha256:e16740707de2ebed45c05d507f33ef204902349c7356d720610b5ec6a35d3d88 + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Validate source maps + command: yarn validate-source-maps + test-mozilla-lint: docker: - image: circleci/node@sha256:e16740707de2ebed45c05d507f33ef204902349c7356d720610b5ec6a35d3d88 From c33eecb33befb270e2a0231777a5860b9a935b12 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Tue, 4 Aug 2020 13:02:48 -0700 Subject: [PATCH 33/44] Fix connection removal bug (#9137) * fix remove connections bug --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 5aa4539e3..41a2d8fb3 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1722,7 +1722,7 @@ export default class MetamaskController extends EventEmitter { delete connections[id] - if (Object.keys(connections.length === 0)) { + if (Object.keys(connections).length === 0) { delete this.connections[origin] } } From a1682554bfd486962154c0a6bfe486e23c7247ca Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Thu, 6 Aug 2020 12:30:28 -0700 Subject: [PATCH 34/44] Update 'react-devtools' to ^4.8.0 (#9140) * bump-react-devtools * Completed yarn lock after version bump of react-devtools --- package.json | 2 +- yarn.lock | 289 ++++++++++++++++++++++++++------------------------- 2 files changed, 151 insertions(+), 140 deletions(-) diff --git a/package.json b/package.json index 578574cb9..0472e8e56 100644 --- a/package.json +++ b/package.json @@ -255,7 +255,7 @@ "proxyquire": "^2.1.3", "randomcolor": "^0.5.4", "rc": "^1.2.8", - "react-devtools": "^4.4.0", + "react-devtools": "^4.8.0", "react-test-renderer": "^16.12.0", "read-installed": "^4.0.3", "redux-mock-store": "^1.5.4", diff --git a/yarn.lock b/yarn.lock index 885354726..9938af518 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1104,6 +1104,22 @@ resolved "https://registry.yarnpkg.com/@download/blockies/-/blockies-1.0.3.tgz#9aea770f9de72f3f947f1b3a53ee1e92f8dc4a68" integrity sha512-iGDh2M6pFuXg9kyW+U//963LKylSLFpLG5hZvUppCjhkiDwsYquQPyamxCQlLASYySS3gGKAki2eWG9qIHKCew== +"@electron/get@^1.0.1": + version "1.12.2" + resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.12.2.tgz#6442066afb99be08cefb9a281e4b4692b33764f3" + integrity sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg== + dependencies: + debug "^4.1.1" + env-paths "^2.2.0" + fs-extra "^8.1.0" + got "^9.6.0" + progress "^2.0.3" + sanitize-filename "^1.6.2" + sumchecker "^3.0.1" + optionalDependencies: + global-agent "^2.0.2" + global-tunnel-ng "^2.7.1" + "@emotion/cache@^10.0.27": version "10.0.27" resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.27.tgz#7895db204e2c1a991ae33d51262a3a44f6737303" @@ -2604,6 +2620,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.14.tgz#a47955df2acf76ba7f0ac3b205d325da193dc9ad" integrity sha512-xXD08vZsvpv4xptQXj1+ky22f7ZoKu5ZNI/4l+/BXG3X+XaeZsmaFbbTKuhSE3NjjvRuZFxFf9sQBMXIcZNFMQ== +"@types/node@^12.0.12": + version "12.12.54" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.54.tgz#a4b58d8df3a4677b6c08bfbc94b7ad7a7a5f82d1" + integrity sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w== + "@types/node@^12.6.1": version "12.12.38" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.38.tgz#58841a382f231ad005dbb935c36d44aa1118a26b" @@ -5490,6 +5511,11 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= +boolean@^3.0.0, boolean@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.0.1.tgz#35ecf2b4a2ee191b0b44986f14eb5f052a5cbb4f" + integrity sha512-HRZPIjPcbwAVQvOTxR4YE3o8Xs98NqbbL1iEZDCz7CL8ql0Lt5iOyJFxfnAB0oFs8Oh02F/lLlg30Mexv46LjA== + boom@^7.2.0: version "7.3.0" resolved "https://registry.yarnpkg.com/boom/-/boom-7.3.0.tgz#733a6d956d33b0b1999da3fe6c12996950d017b9" @@ -7326,6 +7352,11 @@ core-js@^3.0.4: resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647" integrity sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw== +core-js@^3.6.5: + version "3.6.5" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a" + integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -7999,14 +8030,6 @@ d@1: dependencies: es5-ext "^0.10.9" -d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - dash-ast@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" @@ -8124,7 +8147,7 @@ debug-fabulous@1.X: memoizee "0.4.X" object-assign "4.X" -debug@2, debug@2.6.9, debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: +debug@2, debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -9047,21 +9070,6 @@ ejs@^3.0.2: dependencies: jake "^10.6.1" -electron-download@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8" - integrity sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg== - dependencies: - debug "^3.0.0" - env-paths "^1.0.0" - fs-extra "^4.0.1" - minimist "^1.2.0" - nugget "^2.0.1" - path-exists "^3.0.0" - rc "^1.2.1" - semver "^5.4.1" - sumchecker "^2.0.2" - electron-to-chromium@^1.3.122: version "1.3.146" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.146.tgz#d7010f417f87c2068fbb6700ae57767e2393eba7" @@ -9077,13 +9085,13 @@ electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.488: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.498.tgz#fd7188c8a49d6d0b5df1df55a1f1a4bf2c177457" integrity sha512-W1hGwaQEU8j9su2jeAr3aabkPuuXw+j8t73eajGAkEJWbfWiwbxBwQN/8Qmv2qCy3uCDm2rOAaZneYQM8VGC4w== -electron@^5.0.0: - version "5.0.12" - resolved "https://registry.yarnpkg.com/electron/-/electron-5.0.12.tgz#2d5438f8e2b8b99ea99848b61238fc66c283e861" - integrity sha512-Ydby8wfShB39MkZCF2PcAuNACj4PYbGxc0hGpThqZOiDgnSVroqvUAOSX9GCJogrjcP30ZZIe6TgPtQEABYg3w== +electron@^9.1.0: + version "9.1.2" + resolved "https://registry.yarnpkg.com/electron/-/electron-9.1.2.tgz#bfa26d6b192ea13abb6f1461371fd731a8358988" + integrity sha512-xEYadr3XqIqJ4ktBPo0lhzPdovv4jLCpiUUGc2M1frUhFhwqXokwhPaTUcE+zfu5+uf/ONDnQApwjzznBsRrgQ== dependencies: - "@types/node" "^10.12.18" - electron-download "^4.1.0" + "@electron/get" "^1.0.1" + "@types/node" "^12.0.12" extract-zip "^1.0.3" element-resize-detector@^1.2.1: @@ -9247,10 +9255,10 @@ env-ci@^2.1.0: execa "^1.0.0" java-properties "^0.2.9" -env-paths@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" - integrity sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA= +env-paths@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" + integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== envify@^4.1.0: version "4.1.0" @@ -9480,7 +9488,7 @@ es5-shim@^4.5.13: resolved "https://registry.yarnpkg.com/es5-shim/-/es5-shim-4.5.13.tgz#5d88062de049f8969f83783f4a4884395f21d28b" integrity sha512-xi6hh6gsvDE0MaW4Vp1lgNEBpVcCXRWfPXj5egDvtgLz4L9MEvNwYEMdJH+JJinWkwa8c3c3o5HduV7dB/e1Hw== -es6-error@^4.0.1: +es6-error@^4.0.1, es6-error@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== @@ -9547,14 +9555,6 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: d "1" es5-ext "~0.10.14" -es6-symbol@^3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" @@ -9580,6 +9580,11 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escodegen@1.x.x, escodegen@^1.11.1, escodegen@^1.9.0, escodegen@^1.9.1: version "1.14.3" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" @@ -11022,13 +11027,6 @@ ext-name@^5.0.0: ext-list "^2.0.0" sort-keys-length "^1.0.0" -ext@^1.1.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" - integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== - dependencies: - type "^2.0.0" - extend-shallow@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" @@ -11886,7 +11884,7 @@ fs-extra@^1.0.0: jsonfile "^2.1.0" klaw "^1.0.0" -fs-extra@^4.0.1, fs-extra@^4.0.2: +fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== @@ -12420,6 +12418,19 @@ glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" +global-agent@^2.0.2: + version "2.1.12" + resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-2.1.12.tgz#e4ae3812b731a9e81cbf825f9377ef450a8e4195" + integrity sha512-caAljRMS/qcDo69X9BfkgrihGUgGx44Fb4QQToNQjsiWh+YlQ66uqYVAdA8Olqit+5Ng0nkz09je3ZzANMZcjg== + dependencies: + boolean "^3.0.1" + core-js "^3.6.5" + es6-error "^4.1.1" + matcher "^3.0.0" + roarr "^2.15.3" + semver "^7.3.2" + serialize-error "^7.0.1" + global-dirs@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" @@ -12463,6 +12474,16 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" +global-tunnel-ng@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz#d03b5102dfde3a69914f5ee7d86761ca35d57d8f" + integrity sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg== + dependencies: + encodeurl "^1.0.2" + lodash "^4.17.10" + npm-conf "^1.1.3" + tunnel "^0.0.6" + global@^4.3.2, global@~4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" @@ -12505,6 +12526,13 @@ globalthis@^1.0.0: function-bind "^1.1.1" object-keys "^1.0.12" +globalthis@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.1.tgz#40116f5d9c071f9e8fb0037654df1ab3a83b7ef9" + integrity sha512-mJPRTc/P39NH/iNG4mXa9aIhNymaQikTrnspeCa2ZuJ+mH2QN/rXwtX3XwKrHqWgUQFbNZKtHM105aHzJalElw== + dependencies: + define-properties "^1.1.3" + globby@8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" @@ -17684,6 +17712,13 @@ matchdep@^2.0.0: resolve "^1.4.0" stack-trace "0.0.10" +matcher@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/matcher/-/matcher-3.0.0.tgz#bd9060f4c5b70aa8041ccc6f80368760994f30ca" + integrity sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng== + dependencies: + escape-string-regexp "^4.0.0" + material-colors@^1.2.1: version "1.2.5" resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.5.tgz#5292593e6754cb1bcc2b98030e4e0d6a3afc9ea1" @@ -17813,7 +17848,7 @@ memory-fs@^0.4.0, memory-fs@^0.4.1: errno "^0.1.3" readable-stream "^2.0.1" -meow@^3.1.0, meow@^3.3.0, meow@^3.7.0: +meow@^3.3.0, meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= @@ -18145,7 +18180,7 @@ minimist-options@^4.0.2: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.0: +minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@~1.2.0: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== @@ -19105,7 +19140,7 @@ npm-bundled@^1.0.1: resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== -npm-conf@^1.1.0: +npm-conf@^1.1.0, npm-conf@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/npm-conf/-/npm-conf-1.1.3.tgz#256cc47bd0e218c259c4e9550bf413bc2192aff9" integrity sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw== @@ -19152,19 +19187,6 @@ nth-check@~1.0.1: dependencies: boolbase "~1.0.0" -nugget@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/nugget/-/nugget-2.0.1.tgz#201095a487e1ad36081b3432fa3cada4f8d071b0" - integrity sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA= - dependencies: - debug "^2.1.3" - minimist "^1.1.0" - pretty-bytes "^1.0.2" - progress-stream "^1.1.0" - request "^2.45.0" - single-line-log "^1.1.2" - throttleit "0.0.2" - num2fraction@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" @@ -21042,14 +21064,6 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= -pretty-bytes@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84" - integrity sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ= - dependencies: - get-stdin "^4.0.1" - meow "^3.1.0" - pretty-bytes@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.3.0.tgz#f2849e27db79fb4d6cfe24764fc4134f165989f2" @@ -21123,14 +21137,6 @@ process@~0.5.1: resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= -progress-stream@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/progress-stream/-/progress-stream-1.2.0.tgz#2cd3cfea33ba3a89c9c121ec3347abe9ab125f77" - integrity sha1-LNPP6jO6OonJwSHsM0er6asSX3c= - dependencies: - speedometer "~0.1.2" - through2 "~0.2.3" - progress-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress-stream/-/progress-stream-2.0.0.tgz#fac63a0b3d11deacbb0969abcc93b214bce19ed5" @@ -21851,7 +21857,7 @@ raw-loader@^3.1.0: loader-utils "^1.1.0" schema-utils "^2.0.1" -rc@^1.0.1, rc@^1.1.6, rc@^1.2.1, rc@^1.2.7, rc@^1.2.8: +rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -21911,25 +21917,24 @@ react-dev-utils@^9.0.0: strip-ansi "5.2.0" text-table "0.2.0" -react-devtools-core@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.4.0.tgz#614cabe5f3d6fb69730dc76da10f8fa4eb033695" - integrity sha512-ayyz+clbjekj5rqTjieI/eE0xGZkgotklVnxfa4Pyk9se5+AHUAhUwMhLvK5N2+mR2PGOZkv159RDTmvgs+wZQ== +react-devtools-core@4.8.2: + version "4.8.2" + resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.8.2.tgz#4465f2e8de7795564aa20f28b2f3a9737586db23" + integrity sha512-3Lv3nI8FPAwKqUco35oOlgf+4j8mgYNnIcDv2QTfxEqg2G69q17ZJ8ScU9aBnymS28YC1OW+kTxLmdIQeTN8yg== dependencies: - es6-symbol "^3" shell-quote "^1.6.1" ws "^7" -react-devtools@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/react-devtools/-/react-devtools-4.4.0.tgz#03df973d889583bc75afdf3352d3bb29141b3f36" - integrity sha512-Wfa7re+BJGy8fyYodbOfjB1YILKspmfgXLSZ0nPaVvaCpfy2lEqy3Unz5bOzOWoFsDldg7wVL2Xy0LOjd3rz1A== +react-devtools@^4.8.0: + version "4.8.2" + resolved "https://registry.yarnpkg.com/react-devtools/-/react-devtools-4.8.2.tgz#24c2e1d4975ac087665ab48c925cd418a97797c2" + integrity sha512-NGANnExgSsd34IGJlKURCBtDG6Avi2LeWcqfLQ7/oG7khCT6Wm390ZM+GBnI1gGnZD7y/h7oWXd5B/Dp2s5s6Q== dependencies: cross-spawn "^5.0.1" - electron "^5.0.0" + electron "^9.1.0" ip "^1.1.4" - minimist "^1.2.0" - react-devtools-core "4.4.0" + minimist "^1.2.3" + react-devtools-core "4.8.2" update-notifier "^2.1.0" react-dnd-html5-backend@^7.4.4: @@ -22429,7 +22434,7 @@ read-pkg@^5.2.0: string_decoder "~1.0.3" util-deprecate "~1.0.1" -readable-stream@1.1, readable-stream@1.1.x, readable-stream@^1.0.33, readable-stream@~1.1.9: +readable-stream@1.1, readable-stream@1.1.x, readable-stream@^1.0.33: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= @@ -23054,7 +23059,7 @@ request-promise-native@^1.0.5: tunnel-agent "^0.6.0" uuid "^3.3.2" -request@^2.45.0, request@^2.81.0, request@^2.83.0: +request@^2.81.0, request@^2.83.0: version "2.87.0" resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" integrity sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw== @@ -23349,6 +23354,18 @@ rn-host-detect@^1.1.5: resolved "https://registry.yarnpkg.com/rn-host-detect/-/rn-host-detect-1.1.5.tgz#fbecb982b73932f34529e97932b9a63e58d8deb6" integrity sha512-ufk2dFT3QeP9HyZ/xTuMtW27KnFy815CYitJMqQm+pgG3ZAtHBsrU8nXizNKkqXGy3bQmhEoloVbrfbvMJMqkg== +roarr@^2.15.3: + version "2.15.3" + resolved "https://registry.yarnpkg.com/roarr/-/roarr-2.15.3.tgz#65248a291a15af3ebfd767cbf7e44cb402d1d836" + integrity sha512-AEjYvmAhlyxOeB9OqPUzQCo3kuAkNfuDk/HqWbZdFsqDFpapkTjiw+p4svNEoRLvuqNTxqfL+s+gtD4eDgZ+CA== + dependencies: + boolean "^3.0.0" + detect-node "^2.0.4" + globalthis "^1.0.1" + json-stringify-safe "^5.0.1" + semver-compare "^1.0.0" + sprintf-js "^1.1.2" + rpc-cap@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/rpc-cap/-/rpc-cap-3.1.0.tgz#61ae8ca27c43da93f40972393ff34df1a28c3b5e" @@ -23507,6 +23524,13 @@ sanitize-filename@^1.6.1: dependencies: truncate-utf8-bytes "^1.0.0" +sanitize-filename@^1.6.2: + version "1.6.3" + resolved "https://registry.yarnpkg.com/sanitize-filename/-/sanitize-filename-1.6.3.tgz#755ebd752045931977e30b2025d340d7c9090378" + integrity sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg== + dependencies: + truncate-utf8-bytes "^1.0.0" + sass-graph@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.5.tgz#a981c87446b8319d96dce0671e487879bd24c2e8" @@ -23757,6 +23781,11 @@ semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -23808,6 +23837,11 @@ semver@^6.0.0, semver@^6.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== +semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -23832,6 +23866,13 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" +serialize-error@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18" + integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw== + dependencies: + type-fest "^0.13.1" + serialize-javascript@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" @@ -24162,13 +24203,6 @@ single-call-balance-checker-abi@^1.0.0: resolved "https://registry.yarnpkg.com/single-call-balance-checker-abi/-/single-call-balance-checker-abi-1.0.0.tgz#b369009fd4cc6214968cdba650ad93986315d92d" integrity sha512-T5fRBJHmGEMe76JFGB36gcZnOh1ip2S7Qsp7cwmwrfMRjadxTe02zJHtXERpnQf2yvSqNWRxvae5f6e8v4rhng== -single-line-log@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/single-line-log/-/single-line-log-1.1.2.tgz#c2f83f273a3e1a16edb0995661da0ed5ef033364" - integrity sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q= - dependencies: - string-width "^1.0.1" - sinon@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/sinon/-/sinon-9.0.0.tgz#9f1ed502fa2e287e65220de08f6a44f33e314006" @@ -24562,11 +24596,6 @@ specificity@^0.4.1: resolved "https://registry.yarnpkg.com/specificity/-/specificity-0.4.1.tgz#aab5e645012db08ba182e151165738d00887b019" integrity sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg== -speedometer@~0.1.2: - version "0.1.4" - resolved "https://registry.yarnpkg.com/speedometer/-/speedometer-0.1.4.tgz#9876dbd2a169d3115402d48e6ea6329c8816a50d" - integrity sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0= - speedometer@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/speedometer/-/speedometer-1.0.0.tgz#cd671cb06752c22bca3370e2f334440be4fc62e2" @@ -24607,7 +24636,7 @@ split@^1.0.1: dependencies: through "2" -sprintf-js@1.1.2: +sprintf-js@1.1.2, sprintf-js@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== @@ -25284,12 +25313,12 @@ sugarss@^2.0.0: dependencies: postcss "^7.0.2" -sumchecker@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e" - integrity sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4= +sumchecker@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-3.0.1.tgz#6377e996795abb0b6d348e9b3e1dfb24345a8e42" + integrity sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg== dependencies: - debug "^2.2.0" + debug "^4.1.0" summary@0.3.x: version "0.3.2" @@ -25773,11 +25802,6 @@ throttle-debounce@^2.1.0: resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-2.1.0.tgz#257e648f0a56bd9e54fe0f132c4ab8611df4e1d5" integrity sha512-AOvyNahXQuU7NN+VVvOOX+uW6FPaWdAOdRP5HfwYxAfCzXTFKRMoIMk+n+po318+ktcChx+F1Dd91G3YHeMKyg== -throttleit@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-0.0.2.tgz#cfedf88e60c00dd9697b61fdd2a8343a9b680eaf" - integrity sha1-z+34jmDADdlpe2H90qg0OptoDq8= - throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -25821,14 +25845,6 @@ through2@^2.0.2, through2@^2.0.5: readable-stream "~2.3.6" xtend "~4.0.1" -through2@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.2.3.tgz#eb3284da4ea311b6cc8ace3653748a52abf25a3f" - integrity sha1-6zKE2k6jEbbMis42U3SKUqvyWj8= - dependencies: - readable-stream "~1.1.9" - xtend "~2.1.1" - through@2, "through@>=2.2.7 <3", through@^2.3.6, through@^2.3.7, through@^2.3.8, through@~2.3, through@~2.3.1, through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -26233,6 +26249,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tunnel@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + tweetnacl-util@^0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.0.tgz#4576c1cee5e2d63d207fee52f1ba02819480bc75" @@ -26303,16 +26324,6 @@ type-is@^1.6.16, type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" - integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== - typed-styles@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9" From 86979f37f8f7a41b0bf1451558c06a01f2585a6d Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Fri, 7 Aug 2020 12:33:03 -0230 Subject: [PATCH 35/44] Use luxon@1.24.1 (#9154) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0472e8e56..59b494bff 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "jsonschema": "^1.2.4", "lodash": "^4.17.19", "loglevel": "^1.4.1", - "luxon": "^1.23.0", + "luxon": "^1.24.1", "metamask-logo": "^2.1.4", "multihashes": "^0.4.12", "nanoid": "^2.1.6", diff --git a/yarn.lock b/yarn.lock index 9938af518..9d4efe99f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17590,10 +17590,10 @@ ltgt@~2.1.1: resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" integrity sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ= -luxon@^1.23.0: - version "1.23.0" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.23.0.tgz#23b748ad0f2d5494dc4d2878c19278c1e651410c" - integrity sha512-+6a/bXsCWrrR8vfbL41iM92es12zwV2Rum/KPkT+ubOZnnU3Sqbqok/FmD1xsWlWN2Y9Hu0fU/vNgU24ns7bpA== +luxon@^1.24.1: + version "1.24.1" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.24.1.tgz#a8383266131ed4eaed4b5f430f96f3695403a52a" + integrity sha512-CgnIMKAWT0ghcuWFfCWBnWGOddM0zu6c4wZAWmD0NN7MZTnro0+833DF6tJep+xlxRPg4KtsYEHYLfTMBQKwYg== mafmt@^6.0.0, mafmt@^6.0.2, mafmt@^6.0.4, mafmt@^6.0.7: version "6.0.7" From 1bcdad58154a93a9eba2e461e8f202647ce0cfeb Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Thu, 6 Aug 2020 15:45:02 -0700 Subject: [PATCH 36/44] remove .network-name height --- ui/app/css/itcss/components/network.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/css/itcss/components/network.scss b/ui/app/css/itcss/components/network.scss index 02d0dcfcd..b00fa5ec1 100644 --- a/ui/app/css/itcss/components/network.scss +++ b/ui/app/css/itcss/components/network.scss @@ -75,7 +75,6 @@ white-space: nowrap; text-overflow: ellipsis; overflow: hidden; - height: 16px; } .dropdown-menu-item .fa.delete { From dc69e4e9d345cc5be9f046ce69acd2d814206b8f Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 7 Aug 2020 13:45:49 -0300 Subject: [PATCH 37/44] Change MetaMetrics category for background events (#9155) Background events are now sent in the `Background` category, rather than `backend`. Conventionally we use the term "background" over "backend", as it's not really a "backend" in the normal sense since it's a client background process. Also it's capitalized because all of the other event categories are capitalized as well. The metrics URL has been updated to use `background` instead of `backend` as well, for consistency. Luckily we don't have to worry about our metrics being disjointed due to this name change, because the background metrics never worked to begin with! So there will be none under the old name. The metrics will be made functional in a separate PR. --- app/scripts/lib/backend-metametrics.js | 2 +- app/scripts/metamask-controller.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/backend-metametrics.js b/app/scripts/lib/backend-metametrics.js index baaf1c666..a035b9d91 100644 --- a/app/scripts/lib/backend-metametrics.js +++ b/app/scripts/lib/backend-metametrics.js @@ -14,7 +14,7 @@ export default function backEndMetaMetricsEvent (metaMaskState, eventData) { sendMetaMetricsEvent({ ...stateEventData, ...eventData, - url: METAMETRICS_TRACKING_URL + '/backend', + url: METAMETRICS_TRACKING_URL + '/background', }) } } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 41a2d8fb3..8008cb779 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -257,7 +257,7 @@ export default class MetamaskController extends EventEmitter { errorMessage: txMeta.simulationFails?.reason, }, eventOpts: { - category: 'backend', + category: 'Background', action: 'Transactions', name: 'On Chain Failure', }, From 426ddc801087d162bf533da90e1f2869308f6c43 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 7 Aug 2020 14:57:27 -0300 Subject: [PATCH 38/44] Remove `url` parameter from `metricsEvent` (#9157) * Remove `url` parameter from `metricsEvent` The `url` parameter was used to override the `currentPath`, but it never worked correctly. It was supposed to be used for setting the `url` query parameter that was sent to Matomo, but `currentPath` was always used even if it `url` was set and `currentPath` was empty. Instead, `currentPath` is now always used. There was never a need to provide an "override" for `currentPath` when it can be set directly. The metrics provider does set `currentPath` automatically by default, but this can be overwritten already by passing a second parameter to `metricsEvent`. There were two places this `url` parameter was being used: background events, and path changes. Background events were submitted with no `currentPath`, so because of the bug with the `url` parameter, the metrics utility would crash upon each event. So those were never actually sent. This commit will fix that crash. The `currentPath` parameter was supplied as an empty string for the path change events, so those never crashed. They just had the `url` query string parameter set incorrectly (to an empty string). It should now be correctly populated, which should mean we'll be capturing all path changes now. Previously we were only capturing path changes to pages that happened to include an event, because of this blank `url` problem. * Use `url` query parameter as fallback for generating `pv_id` The `pv_id` parameter currently isn't generated correctly on Firefox, as the generation assumes that the current URL starts with `chrome-extension://`. The `url` query parameter is still unique for each path, so it's probably good enough for generating an id for each page. This is just a temporary fix; it will be removed in a future PR, where Firefox will be properly supported. --- app/scripts/lib/backend-metametrics.js | 2 +- ui/app/helpers/utils/metametrics.util.js | 8 +++----- ui/app/pages/routes/routes.component.js | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/scripts/lib/backend-metametrics.js b/app/scripts/lib/backend-metametrics.js index a035b9d91..9328fa3af 100644 --- a/app/scripts/lib/backend-metametrics.js +++ b/app/scripts/lib/backend-metametrics.js @@ -14,7 +14,7 @@ export default function backEndMetaMetricsEvent (metaMaskState, eventData) { sendMetaMetricsEvent({ ...stateEventData, ...eventData, - url: METAMETRICS_TRACKING_URL + '/background', + currentPath: METAMETRICS_TRACKING_URL + '/background', }) } } diff --git a/ui/app/helpers/utils/metametrics.util.js b/ui/app/helpers/utils/metametrics.util.js index 98b83f3d8..3cba4f215 100644 --- a/ui/app/helpers/utils/metametrics.util.js +++ b/ui/app/helpers/utils/metametrics.util.js @@ -13,7 +13,7 @@ const METAMETRICS_BASE_URL = 'https://chromeextensionmm.innocraft.cloud/piwik.ph const METAMETRICS_REQUIRED_PARAMS = `?idsite=${projectId}&rec=1&apiv=1` const METAMETRICS_BASE_FULL = METAMETRICS_BASE_URL + METAMETRICS_REQUIRED_PARAMS -const METAMETRICS_TRACKING_URL = inDevelopment +export const METAMETRICS_TRACKING_URL = inDevelopment ? 'http://www.metamask.io/metametrics' : 'http://www.metamask.io/metametrics-prod' @@ -119,7 +119,6 @@ function composeParamAddition (paramValue, paramName) { * @property {string} config.currentPath The location path the user is on at the time of the event * @property {string} config.metaMetricsId A random id assigned to a user at the time of opting in to metametrics. A hexadecimal number * @property {string} config.confirmTransactionOrigin The origin on a transaction - * @property {string} config.url The url to track an event at. Overrides `currentPath` * @property {boolean} config.excludeMetaMetricsId Whether or not the tracked event data should be associated with a metametrics id * @property {boolean} config.isNewVisit Whether or not the event should be tracked as a new visit/user sessions * @returns {string} - Returns a url to be passed to fetch to make the appropriate request to matomo. @@ -141,7 +140,6 @@ function composeUrl (config) { currentPath, metaMetricsId, confirmTransactionOrigin, - url: configUrl, excludeMetaMetricsId, isNewVisit, } = config @@ -167,10 +165,10 @@ function composeUrl (config) { numberOfTokens: (customVariables && customVariables.numberOfTokens) || numberOfTokens, numberOfAccounts: (customVariables && customVariables.numberOfAccounts) || numberOfAccounts, }) : '' - const url = configUrl || currentPath ? `&url=${encodeURIComponent(currentPath.replace(/chrome-extension:\/\/\w+/, METAMETRICS_TRACKING_URL))}` : '' + const url = currentPath ? `&url=${encodeURIComponent(currentPath.replace(/chrome-extension:\/\/\w+/, METAMETRICS_TRACKING_URL))}` : '' const _id = metaMetricsId && !excludeMetaMetricsId ? `&_id=${metaMetricsId.slice(2, 18)}` : '' const rand = `&rand=${String(Math.random()).slice(2)}` - const pv_id = ((url || currentPath) && `&pv_id=${ethUtil.bufferToHex(ethUtil.sha3(url || currentPath.match(/chrome-extension:\/\/\w+\/(.+)/)[0])).slice(2, 8)}`) || '' + const pv_id = currentPath ? `&pv_id=${ethUtil.bufferToHex(ethUtil.sha3(currentPath.match(/chrome-extension:\/\/\w+\/(.+)/)?.[0] || url)).slice(2, 8)}` : '' const uid = metaMetricsId && !excludeMetaMetricsId ? `&uid=${metaMetricsId.slice(2, 18)}` : excludeMetaMetricsId diff --git a/ui/app/pages/routes/routes.component.js b/ui/app/pages/routes/routes.component.js index 1dc556a98..1aca07f07 100644 --- a/ui/app/pages/routes/routes.component.js +++ b/ui/app/pages/routes/routes.component.js @@ -52,6 +52,8 @@ import { UNLOCK_ROUTE, } from '../../helpers/constants/routes' +import { METAMETRICS_TRACKING_URL } from '../../helpers/utils/metametrics.util' + import { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../app/scripts/lib/util' @@ -98,11 +100,9 @@ export default class Routes extends Component { this.props.history.listen((locationObj, action) => { if (action === 'PUSH') { pageChanged(locationObj.pathname) - const url = `&url=${encodeURIComponent('http://www.metamask.io/metametrics' + locationObj.pathname)}` this.context.metricsEvent({}, { - currentPath: '', + currentPath: `${METAMETRICS_TRACKING_URL}${locationObj.pathname}`, pathname: locationObj.pathname, - url, pageOpts: { hideDimensions: true, }, From f39498703e13b54ce918866b14ebcb1e0252c8a2 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 7 Aug 2020 15:32:46 -0300 Subject: [PATCH 39/44] Use `pathname` instead of URL for `currentPath` metrics parameter (#9158) The `currentPath` parameter passed to our metrics utility had been passed the full URL rather than just the path, contrary to what the name would imply. We only used the path portion, so passing the full URL did lead to complications. Now just the `pathname` is passed in, rather than the full URL. This simplifies the metrics logic, and it incidentally fixes two bugs. The main bug fixed is regarding Firefox metrics. Previously we had assumed the `currentPath` would start with `chrome-extension://`, which of course was not true on Firefox. This lead to us incorrectly parsing the `currentPath`, so path tracking was broken for Firefox events. This broken parsing is now bypassed entirely, so metrics should now work the same on Firefox as on Chrome. The second bug was that we were incorrectly setting the tracking URL for background events during tests. As a result, we were incorrectly detecting ourselves as an internal site that had referred the user to us. But this was not of major concern, since it only affected test metrics (which get sent to the development Matomo project). Lastly, this change let us discard the `pathname` parameter used in the `overrides` parameter of the `metricsEvent` function. Now that `currentPath` is equivalent to `pathname`, the `pathname` parameter is redundant. --- app/scripts/lib/backend-metametrics.js | 8 +------- ui/app/contexts/metametrics.js | 8 ++++---- ui/app/helpers/utils/metametrics.util.js | 12 ++++++------ ui/app/pages/routes/routes.component.js | 5 +---- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/app/scripts/lib/backend-metametrics.js b/app/scripts/lib/backend-metametrics.js index 9328fa3af..e62f09d0d 100644 --- a/app/scripts/lib/backend-metametrics.js +++ b/app/scripts/lib/backend-metametrics.js @@ -1,12 +1,6 @@ import { getBackgroundMetaMetricState } from '../../../ui/app/selectors' import { sendMetaMetricsEvent } from '../../../ui/app/helpers/utils/metametrics.util' -const inDevelopment = process.env.NODE_ENV === 'development' - -const METAMETRICS_TRACKING_URL = inDevelopment - ? 'http://www.metamask.io/metametrics' - : 'http://www.metamask.io/metametrics-prod' - export default function backEndMetaMetricsEvent (metaMaskState, eventData) { const stateEventData = getBackgroundMetaMetricState({ metamask: metaMaskState }) @@ -14,7 +8,7 @@ export default function backEndMetaMetricsEvent (metaMaskState, eventData) { sendMetaMetricsEvent({ ...stateEventData, ...eventData, - currentPath: METAMETRICS_TRACKING_URL + '/background', + currentPath: '/background', }) } } diff --git a/ui/app/contexts/metametrics.js b/ui/app/contexts/metametrics.js index ced6d4944..b1440429e 100644 --- a/ui/app/contexts/metametrics.js +++ b/ui/app/contexts/metametrics.js @@ -41,7 +41,7 @@ export function MetaMetricsProvider ({ children }) { const numberOfAccounts = useSelector(getNumberOfAccounts) const history = useHistory() const [state, setState] = useState(() => ({ - currentPath: window.location.href, + currentPath: (new URL(window.location.href)).pathname, previousPath: '', })) @@ -49,7 +49,7 @@ export function MetaMetricsProvider ({ children }) { useEffect(() => { const unlisten = history.listen(() => setState((prevState) => ({ - currentPath: window.location.href, + currentPath: (new URL(window.location.href)).pathname, previousPath: prevState.currentPath, }))) // remove this listener if the component is no longer mounted @@ -59,8 +59,8 @@ export function MetaMetricsProvider ({ children }) { const metricsEvent = useCallback((config = {}, overrides = {}) => { const { eventOpts = {} } = config const { name = '' } = eventOpts - const { pathname: overRidePathName = '' } = overrides - const isSendFlow = Boolean(name.match(/^send|^confirm/) || overRidePathName.match(/send|confirm/)) + const { currentPath: overrideCurrentPath = '' } = overrides + const isSendFlow = Boolean(name.match(/^send|^confirm/) || overrideCurrentPath.match(/send|confirm/)) if (participateInMetaMetrics || config.isOptIn) { return sendMetaMetricsEvent({ diff --git a/ui/app/helpers/utils/metametrics.util.js b/ui/app/helpers/utils/metametrics.util.js index 3cba4f215..d2563c7fc 100644 --- a/ui/app/helpers/utils/metametrics.util.js +++ b/ui/app/helpers/utils/metametrics.util.js @@ -13,7 +13,7 @@ const METAMETRICS_BASE_URL = 'https://chromeextensionmm.innocraft.cloud/piwik.ph const METAMETRICS_REQUIRED_PARAMS = `?idsite=${projectId}&rec=1&apiv=1` const METAMETRICS_BASE_FULL = METAMETRICS_BASE_URL + METAMETRICS_REQUIRED_PARAMS -export const METAMETRICS_TRACKING_URL = inDevelopment +const METAMETRICS_TRACKING_URL = inDevelopment ? 'http://www.metamask.io/metametrics' : 'http://www.metamask.io/metametrics-prod' @@ -74,7 +74,7 @@ const customDimensionsNameIdMap = { function composeUrlRefParamAddition (previousPath, confirmTransactionOrigin) { const externalOrigin = confirmTransactionOrigin && confirmTransactionOrigin !== 'metamask' - return `&urlref=${externalOrigin ? 'EXTERNAL' : encodeURIComponent(previousPath.replace(/chrome-extension:\/\/\w+/, METAMETRICS_TRACKING_URL))}` + return `&urlref=${externalOrigin ? 'EXTERNAL' : encodeURIComponent(`${METAMETRICS_TRACKING_URL}${previousPath}`)}` } // composes query params of the form &dimension[0-999]=[value] @@ -115,8 +115,8 @@ function composeParamAddition (paramValue, paramName) { * @property {string} config.accountType The account type being used at the time of the event: 'hardware', 'imported' or 'default' * @property {number} config.numberOfTokens The number of tokens that the user has added at the time of the event * @property {number} config.numberOfAccounts The number of accounts the user has added at the time of the event - * @property {string} config.previousPath The location path the user was on prior to the path they are on at the time of the event - * @property {string} config.currentPath The location path the user is on at the time of the event + * @property {string} config.previousPath The pathname of the URL the user was on prior to the URL they are on at the time of the event + * @property {string} config.currentPath The pathname of the URL the user is on at the time of the event * @property {string} config.metaMetricsId A random id assigned to a user at the time of opting in to metametrics. A hexadecimal number * @property {string} config.confirmTransactionOrigin The origin on a transaction * @property {boolean} config.excludeMetaMetricsId Whether or not the tracked event data should be associated with a metametrics id @@ -165,10 +165,10 @@ function composeUrl (config) { numberOfTokens: (customVariables && customVariables.numberOfTokens) || numberOfTokens, numberOfAccounts: (customVariables && customVariables.numberOfAccounts) || numberOfAccounts, }) : '' - const url = currentPath ? `&url=${encodeURIComponent(currentPath.replace(/chrome-extension:\/\/\w+/, METAMETRICS_TRACKING_URL))}` : '' + const url = currentPath ? `&url=${encodeURIComponent(`${METAMETRICS_TRACKING_URL}${currentPath}`)}` : '' const _id = metaMetricsId && !excludeMetaMetricsId ? `&_id=${metaMetricsId.slice(2, 18)}` : '' const rand = `&rand=${String(Math.random()).slice(2)}` - const pv_id = currentPath ? `&pv_id=${ethUtil.bufferToHex(ethUtil.sha3(currentPath.match(/chrome-extension:\/\/\w+\/(.+)/)?.[0] || url)).slice(2, 8)}` : '' + const pv_id = currentPath ? `&pv_id=${ethUtil.bufferToHex(ethUtil.sha3(currentPath)).slice(2, 8)}` : '' const uid = metaMetricsId && !excludeMetaMetricsId ? `&uid=${metaMetricsId.slice(2, 18)}` : excludeMetaMetricsId diff --git a/ui/app/pages/routes/routes.component.js b/ui/app/pages/routes/routes.component.js index 1aca07f07..578483425 100644 --- a/ui/app/pages/routes/routes.component.js +++ b/ui/app/pages/routes/routes.component.js @@ -52,8 +52,6 @@ import { UNLOCK_ROUTE, } from '../../helpers/constants/routes' -import { METAMETRICS_TRACKING_URL } from '../../helpers/utils/metametrics.util' - import { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../app/scripts/lib/util' @@ -101,8 +99,7 @@ export default class Routes extends Component { if (action === 'PUSH') { pageChanged(locationObj.pathname) this.context.metricsEvent({}, { - currentPath: `${METAMETRICS_TRACKING_URL}${locationObj.pathname}`, - pathname: locationObj.pathname, + currentPath: locationObj.pathname, pageOpts: { hideDimensions: true, }, From 500dbf76cfa64837921a7cb5a6154f112989195f Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Fri, 7 Aug 2020 12:28:23 -0700 Subject: [PATCH 40/44] Add web3 usage metrics, prepare for web3 removal (#9144) * add web3 usage metrics * move web3 metrics method to new middleware * rename some methods, files, and exports --- app/scripts/controllers/permissions/index.js | 4 +- ...ware.js => permissionsMethodMiddleware.js} | 2 +- app/scripts/inpage.js | 27 ++--------- ...tametrics.js => background-metametrics.js} | 4 +- app/scripts/lib/createMethodMiddleware.js | 32 +++++++++++++ .../lib/{auto-reload.js => setupWeb3.js} | 47 +++++++++++++++++-- app/scripts/metamask-controller.js | 40 +++++++++++----- ui/app/helpers/utils/metametrics.util.js | 4 +- 8 files changed, 114 insertions(+), 46 deletions(-) rename app/scripts/controllers/permissions/{methodMiddleware.js => permissionsMethodMiddleware.js} (98%) rename app/scripts/lib/{backend-metametrics.js => background-metametrics.js} (78%) create mode 100644 app/scripts/lib/createMethodMiddleware.js rename app/scripts/lib/{auto-reload.js => setupWeb3.js} (64%) diff --git a/app/scripts/controllers/permissions/index.js b/app/scripts/controllers/permissions/index.js index 311a0d1ca..a5aeb7b14 100644 --- a/app/scripts/controllers/permissions/index.js +++ b/app/scripts/controllers/permissions/index.js @@ -7,7 +7,7 @@ import { CapabilitiesController as RpcCap } from 'rpc-cap' import { ethErrors } from 'eth-json-rpc-errors' import { cloneDeep } from 'lodash' -import createMethodMiddleware from './methodMiddleware' +import createPermissionsMethodMiddleware from './permissionsMethodMiddleware' import PermissionsLogController from './permissionsLog' // Methods that do not require any permissions to use: @@ -90,7 +90,7 @@ export class PermissionsController { engine.push(this.permissionsLog.createMiddleware()) - engine.push(createMethodMiddleware({ + engine.push(createPermissionsMethodMiddleware({ addDomainMetadata: this.addDomainMetadata.bind(this), getAccounts: this.getAccounts.bind(this, origin), getUnlockPromise: () => this._getUnlockPromise(true), diff --git a/app/scripts/controllers/permissions/methodMiddleware.js b/app/scripts/controllers/permissions/permissionsMethodMiddleware.js similarity index 98% rename from app/scripts/controllers/permissions/methodMiddleware.js rename to app/scripts/controllers/permissions/permissionsMethodMiddleware.js index 613ea3876..075f67cf8 100644 --- a/app/scripts/controllers/permissions/methodMiddleware.js +++ b/app/scripts/controllers/permissions/permissionsMethodMiddleware.js @@ -4,7 +4,7 @@ import { ethErrors } from 'eth-json-rpc-errors' /** * Create middleware for handling certain methods and preprocessing permissions requests. */ -export default function createMethodMiddleware ({ +export default function createPermissionsMethodMiddleware ({ addDomainMetadata, getAccounts, getUnlockPromise, diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 672502286..c7c92face 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -1,5 +1,3 @@ -/*global Web3*/ - // need to make sure we aren't affected by overlapping namespaces // and that we dont affect the app with our namespace // mostly a fix for web3's BigNumber if AMD's "define" is defined... @@ -37,9 +35,7 @@ import LocalMessageDuplexStream from 'post-message-stream' import { initProvider } from '@metamask/inpage-provider' // TODO:deprecate:2020 -import 'web3/dist/web3.min.js' - -import setupDappAutoReload from './lib/auto-reload.js' +import setupWeb3 from './lib/setupWeb3.js' restoreContextAfterImports() @@ -59,11 +55,9 @@ initProvider({ connectionStream: metamaskStream, }) -// // TODO:deprecate:2020 -// +// Setup web3 -// setup web3 if (typeof window.web3 !== 'undefined') { throw new Error(`MetaMask detected another web3. @@ -73,18 +67,5 @@ if (typeof window.web3 !== 'undefined') { and try again.`) } -const web3 = new Web3(window.ethereum) -web3.setProvider = function () { - log.debug('MetaMask - overrode web3.setProvider') -} -log.debug('MetaMask - injected web3') - -Object.defineProperty(window.ethereum, '_web3Ref', { - enumerable: false, - writable: true, - configurable: true, - value: web3.eth, -}) - -// setup dapp auto reload AND proxy web3 -setupDappAutoReload(web3, window.ethereum._publicConfigStore) +// proxy web3, assign to window, and set up site auto reload +setupWeb3(log) diff --git a/app/scripts/lib/backend-metametrics.js b/app/scripts/lib/background-metametrics.js similarity index 78% rename from app/scripts/lib/backend-metametrics.js rename to app/scripts/lib/background-metametrics.js index e62f09d0d..f381ea3a1 100644 --- a/app/scripts/lib/backend-metametrics.js +++ b/app/scripts/lib/background-metametrics.js @@ -1,13 +1,13 @@ import { getBackgroundMetaMetricState } from '../../../ui/app/selectors' import { sendMetaMetricsEvent } from '../../../ui/app/helpers/utils/metametrics.util' -export default function backEndMetaMetricsEvent (metaMaskState, eventData) { +export default function backgroundMetaMetricsEvent (metaMaskState, eventData) { const stateEventData = getBackgroundMetaMetricState({ metamask: metaMaskState }) - if (stateEventData.participateInMetaMetrics) { sendMetaMetricsEvent({ ...stateEventData, ...eventData, + category: 'Background', currentPath: '/background', }) } diff --git a/app/scripts/lib/createMethodMiddleware.js b/app/scripts/lib/createMethodMiddleware.js new file mode 100644 index 000000000..308cf0a99 --- /dev/null +++ b/app/scripts/lib/createMethodMiddleware.js @@ -0,0 +1,32 @@ +/** + * Returns a middleware that implements the following RPC methods: + * - metamask_logInjectedWeb3Usage + * + * @param {Object} opts - The middleware options + * @param {string} opts.origin - The origin for the middleware stack + * @param {Function} opts.sendMetrics - A function for sending a metrics event + * @returns {(req: any, res: any, next: Function, end: Function) => void} + */ +export default function createMethodMiddleware ({ origin, sendMetrics }) { + return function methodMiddleware (req, res, next, end) { + switch (req.method) { + + case 'metamask_logInjectedWeb3Usage': + + const { action, name } = req.params[0] + + sendMetrics({ + action, + name, + customVariables: { origin }, + }) + + res.result = true + break + + default: + return next() + } + return end() + } +} diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/setupWeb3.js similarity index 64% rename from app/scripts/lib/auto-reload.js rename to app/scripts/lib/setupWeb3.js index 2f50e3e88..da5d8d422 100644 --- a/app/scripts/lib/auto-reload.js +++ b/app/scripts/lib/setupWeb3.js @@ -1,26 +1,67 @@ +/*global Web3*/ // TODO:deprecate:2020 +// Delete this file -export default function setupDappAutoReload (web3, observable) { +import 'web3/dist/web3.min.js' + +const shouldLogUsage = !([ + 'docs.metamask.io', + 'metamask.github.io', + 'metamask.io', +].includes(window.location.hostname)) + +export default function setupWeb3 (log) { // export web3 as a global, checking for usage let reloadInProgress = false let lastTimeUsed let lastSeenNetwork let hasBeenWarned = false + const web3 = new Web3(window.ethereum) + web3.setProvider = function () { + log.debug('MetaMask - overrode web3.setProvider') + } + log.debug('MetaMask - injected web3') + + Object.defineProperty(window.ethereum, '_web3Ref', { + enumerable: false, + writable: true, + configurable: true, + value: web3.eth, + }) + const web3Proxy = new Proxy(web3, { get: (_web3, key) => { + // get the time of use lastTimeUsed = Date.now() + // show warning once on web3 access - if (!hasBeenWarned && key !== 'currentProvider') { + if (!hasBeenWarned) { console.warn(`MetaMask: We will stop injecting web3 in Q4 2020.\nPlease see this article for more information: https://medium.com/metamask/no-longer-injecting-web3-js-4a899ad6e59e`) hasBeenWarned = true } + + if (shouldLogUsage) { + window.ethereum.request({ + method: 'metamask_logInjectedWeb3Usage', + params: [{ action: 'window.web3 get', name: key }], + }) + } + // return value normally return _web3[key] }, set: (_web3, key, value) => { + + if (shouldLogUsage) { + window.ethereum.request({ + method: 'metamask_logInjectedWeb3Usage', + params: [{ action: 'window.web3 set', name: key }], + }) + } + // set value normally _web3[key] = value }, @@ -33,7 +74,7 @@ export default function setupDappAutoReload (web3, observable) { value: web3Proxy, }) - observable.subscribe(function (state) { + window.ethereum._publicConfigStore.subscribe((state) => { // if the auto refresh on network change is false do not // do anything if (!window.ethereum.autoRefreshOnNetworkChange) { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 8008cb779..f9821e822 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -19,6 +19,7 @@ import createEngineStream from 'json-rpc-middleware-stream/engineStream' import createFilterMiddleware from 'eth-json-rpc-filters' import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager' import createLoggerMiddleware from './lib/createLoggerMiddleware' +import createMethodMiddleware from './lib/createMethodMiddleware' import createOriginMiddleware from './lib/createOriginMiddleware' import createTabIdMiddleware from './lib/createTabIdMiddleware' import createOnboardingMiddleware from './lib/createOnboardingMiddleware' @@ -66,7 +67,7 @@ import { PhishingController, } from '@metamask/controllers' -import backEndMetaMetricsEvent from './lib/backend-metametrics' +import backgroundMetaMetricsEvent from './lib/background-metametrics' export default class MetamaskController extends EventEmitter { @@ -249,18 +250,11 @@ export default class MetamaskController extends EventEmitter { this.platform.showTransactionNotification(txMeta) const { txReceipt } = txMeta - const participateInMetaMetrics = this.preferencesController.getParticipateInMetaMetrics() - if (txReceipt && txReceipt.status === '0x0' && participateInMetaMetrics) { - const metamaskState = await this.getState() - backEndMetaMetricsEvent(metamaskState, { - customVariables: { - errorMessage: txMeta.simulationFails?.reason, - }, - eventOpts: { - category: 'Background', - action: 'Transactions', - name: 'On Chain Failure', - }, + if (txReceipt && txReceipt.status === '0x0') { + this.sendBackgroundMetaMetrics({ + action: 'Transactions', + name: 'On Chain Failure', + customVariables: { errorMessage: txMeta.simulationFails?.reason }, }) } } @@ -1637,6 +1631,10 @@ export default class MetamaskController extends EventEmitter { location, registerOnboarding: this.onboardingController.registerOnboarding, })) + engine.push(createMethodMiddleware({ + origin, + sendMetrics: this.sendBackgroundMetaMetrics.bind(this), + })) // filter and subscription polyfills engine.push(filterMiddleware) engine.push(subscriptionManager.middleware) @@ -1837,6 +1835,22 @@ export default class MetamaskController extends EventEmitter { return nonceLock.nextNonce } + async sendBackgroundMetaMetrics ({ action, name, customVariables } = {}) { + + if (!action || !name) { + throw new Error('Must provide action and name.') + } + + const metamaskState = await this.getState() + backgroundMetaMetricsEvent(metamaskState, { + customVariables, + eventOpts: { + action, + name, + }, + }) + } + //============================================================================= // CONFIG //============================================================================= diff --git a/ui/app/helpers/utils/metametrics.util.js b/ui/app/helpers/utils/metametrics.util.js index d2563c7fc..cf9f15720 100644 --- a/ui/app/helpers/utils/metametrics.util.js +++ b/ui/app/helpers/utils/metametrics.util.js @@ -23,7 +23,7 @@ const METAMETRICS_CUSTOM_GAS_LIMIT_CHANGE = 'gasLimitChange' const METAMETRICS_CUSTOM_GAS_PRICE_CHANGE = 'gasPriceChange' const METAMETRICS_CUSTOM_FUNCTION_TYPE = 'functionType' const METAMETRICS_CUSTOM_RECIPIENT_KNOWN = 'recipientKnown' -const METAMETRICS_CUSTOM_CONFIRM_SCREEN_ORIGIN = 'origin' +const METAMETRICS_REQUEST_ORIGIN = 'origin' const METAMETRICS_CUSTOM_FROM_NETWORK = 'fromNetwork' const METAMETRICS_CUSTOM_TO_NETWORK = 'toNetwork' const METAMETRICS_CUSTOM_ERROR_FIELD = 'errorField' @@ -36,7 +36,7 @@ const METAMETRICS_CUSTOM_ASSET_SELECTED = 'assetSelected' const customVariableNameIdMap = { [METAMETRICS_CUSTOM_FUNCTION_TYPE]: 1, [METAMETRICS_CUSTOM_RECIPIENT_KNOWN]: 2, - [METAMETRICS_CUSTOM_CONFIRM_SCREEN_ORIGIN]: 3, + [METAMETRICS_REQUEST_ORIGIN]: 3, [METAMETRICS_CUSTOM_GAS_LIMIT_CHANGE]: 4, [METAMETRICS_CUSTOM_GAS_PRICE_CHANGE]: 5, From c3bc7de412bf45e9d43bc086ef460a91976a7bb6 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Fri, 7 Aug 2020 12:29:50 -0700 Subject: [PATCH 41/44] Remove web3 e2e tests (#9159) --- package.json | 2 - test/e2e/run-web3.sh | 13 -- test/e2e/web3.spec.js | 288 ------------------------------------------ test/web3/index.html | 105 --------------- test/web3/schema.js | 209 ------------------------------ test/web3/web3.js | 34 ----- 6 files changed, 651 deletions(-) delete mode 100755 test/e2e/run-web3.sh delete mode 100644 test/e2e/web3.spec.js delete mode 100644 test/web3/index.html delete mode 100644 test/web3/schema.js delete mode 100644 test/web3/web3.js diff --git a/package.json b/package.json index 59b494bff..c20828989 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,6 @@ "test:unit:strict": "mocha --exit --require test/env.js --require test/setup.js --recursive \"test/unit/**/permissions/*.js\"", "test:unit:path": "mocha --exit --require test/env.js --require test/setup.js --recursive", "test:e2e:chrome": "SELENIUM_BROWSER=chrome test/e2e/run-all.sh", - "test:web3:chrome": "SELENIUM_BROWSER=chrome test/e2e/run-web3.sh", - "test:web3:firefox": "SELENIUM_BROWSER=firefox test/e2e/run-web3.sh", "test:e2e:firefox": "SELENIUM_BROWSER=firefox test/e2e/run-all.sh", "test:coverage": "nyc --silent --check-coverage yarn test:unit:strict && nyc --silent --no-clean yarn test:unit:lax && nyc report --reporter=text --reporter=html", "test:coverage:strict": "nyc --check-coverage yarn test:unit:strict", diff --git a/test/e2e/run-web3.sh b/test/e2e/run-web3.sh deleted file mode 100755 index 729333b84..000000000 --- a/test/e2e/run-web3.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u -set -o pipefail - -export PATH="$PATH:./node_modules/.bin" - -concurrently --kill-others \ - --names 'dapp,e2e' \ - --prefix '[{time}][{name}]' \ - 'node development/static-server.js test/web3 --port 8080' \ - 'sleep 5 && mocha test/e2e/web3.spec' diff --git a/test/e2e/web3.spec.js b/test/e2e/web3.spec.js deleted file mode 100644 index 4bcca74dd..000000000 --- a/test/e2e/web3.spec.js +++ /dev/null @@ -1,288 +0,0 @@ -const assert = require('assert') -const webdriver = require('selenium-webdriver') - -const { By } = webdriver -const { - regularDelayMs, - largeDelayMs, -} = require('./helpers') -const { buildWebDriver } = require('./webdriver') -const enLocaleMessages = require('../../app/_locales/en/messages.json') - -describe('Using MetaMask with an existing account', function () { - let driver - - const testSeedPhrase = 'forum vessel pink push lonely enact gentle tail admit parrot grunt dress' - - const button = async (x) => { - const buttoncheck = x - await buttoncheck.click() - await driver.delay(largeDelayMs) - const [results] = await driver.findElements(By.css('#results')) - const resulttext = await results.getText() - const parsedData = JSON.parse(resulttext) - - return (parsedData) - - } - - this.timeout(0) - this.bail(true) - - before(async function () { - const result = await buildWebDriver() - driver = result.driver - }) - - afterEach(async function () { - if (process.env.SELENIUM_BROWSER === 'chrome') { - const errors = await driver.checkBrowserForConsoleErrors(driver) - if (errors.length) { - const errorReports = errors.map((err) => err.message) - const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}` - console.error(new Error(errorMessage)) - } - } - if (this.currentTest.state === 'failed') { - await driver.verboseReportOnFailure(this.currentTest.title) - } - }) - - after(async function () { - await driver.quit() - }) - - describe('First time flow starting from an existing seed phrase', function () { - it('clicks the continue button on the welcome screen', async function () { - await driver.findElement(By.css('.welcome-page__header')) - await driver.clickElement(By.xpath(`//button[contains(text(), '${enLocaleMessages.getStarted.message}')]`)) - await driver.delay(largeDelayMs) - }) - - it('clicks the "Import Wallet" option', async function () { - await driver.clickElement(By.xpath(`//button[contains(text(), 'Import wallet')]`)) - await driver.delay(largeDelayMs) - }) - - it('clicks the "No thanks" option on the metametrics opt-in screen', async function () { - await driver.clickElement(By.css('.btn-default')) - await driver.delay(largeDelayMs) - }) - - it('imports a seed phrase', async function () { - const [seedTextArea] = await driver.findElements(By.css('input[placeholder="Paste seed phrase from clipboard"]')) - await seedTextArea.sendKeys(testSeedPhrase) - await driver.delay(regularDelayMs) - - const [password] = await driver.findElements(By.id('password')) - await password.sendKeys('correct horse battery staple') - const [confirmPassword] = await driver.findElements(By.id('confirm-password')) - confirmPassword.sendKeys('correct horse battery staple') - - await driver.clickElement(By.css('.first-time-flow__terms')) - - await driver.clickElement(By.xpath(`//button[contains(text(), 'Import')]`)) - await driver.delay(regularDelayMs) - }) - - it('clicks through the success screen', async function () { - await driver.findElement(By.xpath(`//div[contains(text(), 'Congratulations')]`)) - await driver.clickElement(By.xpath(`//button[contains(text(), '${enLocaleMessages.endOfFlowMessage10.message}')]`)) - await driver.delay(regularDelayMs) - }) - }) - - - describe('opens dapp', function () { - - it('switches to mainnet', async function () { - await driver.clickElement(By.css('.network-name')) - await driver.delay(regularDelayMs) - - await driver.clickElement(By.xpath(`//span[contains(text(), 'Main Ethereum Network')]`)) - await driver.delay(largeDelayMs * 2) - }) - - it('connects to dapp', async function () { - await driver.openNewPage('http://127.0.0.1:8080/') - await driver.delay(regularDelayMs) - - await driver.clickElement(By.xpath(`//button[contains(text(), 'Connect')]`)) - - await driver.delay(regularDelayMs) - - await driver.waitUntilXWindowHandles(3) - const windowHandles = await driver.getAllWindowHandles() - - const extension = windowHandles[0] - const popup = await driver.switchToWindowWithTitle('MetaMask Notification', windowHandles) - const dapp = windowHandles.find((handle) => handle !== extension && handle !== popup) - - await driver.delay(regularDelayMs) - await driver.clickElement(By.xpath(`//button[contains(text(), 'Connect')]`)) - - await driver.switchToWindow(dapp) - await driver.delay(regularDelayMs) - }) - }) - - describe('testing web3 methods', function () { - - - it('testing hexa methods', async function () { - - - const List = await driver.findClickableElements(By.className('hexaNumberMethods')) - - for (let i = 0; i < List.length; i++) { - try { - - const parsedData = await button(List[i]) - console.log(parsedData) - const result = parseInt(parsedData.result, 16) - - assert.equal((typeof result === 'number'), true) - await driver.delay(regularDelayMs) - } catch (err) { - console.log(err) - assert(false) - - } - } - }) - - it('testing booleanMethods', async function () { - - const List = await driver.findClickableElement(By.className('booleanMethods')) - - for (let i = 0; i < List.length; i++) { - try { - - const parsedData = await button(List[i]) - console.log(parsedData) - const result = parsedData.result - - assert.equal(result, false) - await driver.delay(regularDelayMs) - } catch (err) { - console.log(err) - assert(false) - - - } - } - - }) - - it('testing transactionMethods', async function () { - - const List = await driver.findClickableElement(By.className('transactionMethods')) - - for (let i = 0; i < List.length; i++) { - try { - - const parsedData = await button(List[i]) - - console.log(parsedData.result.blockHash) - - const result = [] - result.push(parseInt(parsedData.result.blockHash, 16)) - result.push(parseInt(parsedData.result.blockNumber, 16)) - result.push(parseInt(parsedData.result.gas, 16)) - result.push(parseInt(parsedData.result.gasPrice, 16)) - result.push(parseInt(parsedData.result.hash, 16)) - result.push(parseInt(parsedData.result.input, 16)) - result.push(parseInt(parsedData.result.nonce, 16)) - result.push(parseInt(parsedData.result.r, 16)) - result.push(parseInt(parsedData.result.s, 16)) - result.push(parseInt(parsedData.result.v, 16)) - result.push(parseInt(parsedData.result.to, 16)) - result.push(parseInt(parsedData.result.value, 16)) - - - result.forEach((value) => { - assert.equal((typeof value === 'number'), true) - }) - - - } catch (err) { - - console.log(err) - assert(false) - - - } - } - - }) - - it('testing blockMethods', async function () { - - const List = await driver.findClickableElement(By.className('blockMethods')) - - for (let i = 0; i < List.length; i++) { - try { - - const parsedData = await button(List[i]) - console.log(JSON.stringify(parsedData) + i) - - console.log(parsedData.result.parentHash) - - const result = parseInt(parsedData.result.parentHash, 16) - - assert.equal((typeof result === 'number'), true) - await driver.delay(regularDelayMs) - } catch (err) { - - console.log(err) - assert(false) - - - } - } - }) - - it('testing methods', async function () { - - const List = await driver.findClickableElement(By.className('methods')) - let parsedData - let result - - for (let i = 0; i < List.length; i++) { - try { - - if (i === 2) { - - parsedData = await button(List[i]) - console.log(parsedData.result.blockHash) - - result = parseInt(parsedData.result.blockHash, 16) - - assert.equal((typeof result === 'number' || (result === 0)), true) - await driver.delay(regularDelayMs) - } else { - parsedData = await button(List[i]) - console.log(parsedData.result) - - result = parseInt(parsedData.result, 16) - - assert.equal((typeof result === 'number' || (result === 0)), true) - await driver.delay(regularDelayMs) - } - - - } catch (err) { - - console.log(err) - assert(false) - - - } - } - }) - - - }) - - -}) diff --git a/test/web3/index.html b/test/web3/index.html deleted file mode 100644 index cbc43290c..000000000 --- a/test/web3/index.html +++ /dev/null @@ -1,105 +0,0 @@ - - - Web3 Test Dapp - - -
-
hexaNumberMethods
-
- - - - - - - -
-
- - - -
-
- - - - - - -
-
-
-
booleanMethods
-
- - - -
-
-
-
transactionMethods
-
- - - - - -
-
- -
-
blockMethods
- -
- - - - -
-
- - - -
-
- -
-
Methods
-
- - - - -
-
-
-
-
- - - - - - - - - - diff --git a/test/web3/schema.js b/test/web3/schema.js deleted file mode 100644 index 54a6ff1a9..000000000 --- a/test/web3/schema.js +++ /dev/null @@ -1,209 +0,0 @@ -/* eslint no-unused-vars: 0 */ - -const params = { - // diffrent params used in the methods - param: [], - blockHashParams: '0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35', - filterParams: ['0xfe704947a3cd3ca12541458a4321c869'], - transactionHashParams: [ - '0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0', - ], - blockHashAndIndexParams: [ - '0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35', - '0x0', - ], - uncleByBlockNumberAndIndexParams: ['0x29c', '0x0'], - blockParameterParams: '0x5bad55', - data: '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675', - addressParams: '0xc94770007dda54cF92009BFF0dE90c06F603a09f', - getStorageAtParams: [ - '0x295a70b2de5e3953354a6a8344e616ed314d7251', - '0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9', - '0x65a8db', - ], - getCodeParams: ['0x06012c8cf97bead5deae237070f9587f8e7a266d', '0x65a8db'], - estimateTransaction: { - from: '0xb60e8dd61c5d32be8058bb8eb970870f07233155', - to: '0xd46e8dd67c5d32be8058bb8eb970870f07244567', - gas: '0x76c0', - gasPrice: '0x9184e72a000', - value: '0x9184e72a', - data: '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675', - }, - filterGetLogs: [{ 'blockHash': '0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70', 'topics': ['0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80'] }], - block: { - __required: [], - number: 'Q', - hash: 'D32', - parentHash: 'D32', - nonce: 'D', - sha3Uncles: 'D', - logsBloom: 'D', - transactionsRoot: 'D', - stateRoot: 'D', - receiptsRoot: 'D', - miner: 'D', - difficulty: 'Q', - totalDifficulty: 'Q', - extraData: 'D', - size: 'Q', - gasLimit: 'Q', - gasUsed: 'Q', - timestamp: 'Q', - transactions: ['DATA|Transaction'], - uncles: ['D'], - }, - transaction: { - __required: [], - hash: 'D32', - nonce: 'Q', - blockHash: 'D32', - blockNumber: 'Q', - transactionIndex: 'Q', - from: 'D20', - to: 'D20', - value: 'Q', - gasPrice: 'Q', - gas: 'Q', - input: 'D', - }, - receipt: { - __required: [], - transactionHash: 'D32', - transactionIndex: 'Q', - blockHash: 'D32', - blockNumber: 'Q', - cumulativeGasUsed: 'Q', - gasUsed: 'Q', - contractAddress: 'D20', - logs: ['FilterChange'], - }, - - filterChange: { - __required: [], - removed: 'B', - logIndex: 'Q', - transactionIndex: 'Q', - transactionHash: 'D32', - blockHash: 'D32', - blockNumber: 'Q', - address: 'D20', - data: 'Array|DATA', - topics: ['D'], - }, -} - -const methods = { - hexaNumberMethods: { - // these are the methods which have output in the form of hexa decimal numbers - eth_blockNumber: ['eth_blockNumber', params.param, 'Q'], - eth_gasPrice: ['eth_gasPrice', params.param, 'Q'], - eth_newBlockFilter: ['eth_newBlockFilter', params.param, 'Q'], - eth_newPendingTransactionFilter: [ - 'eth_newPendingTransactionFilter', - params.param, - 'Q', - ], - eth_getUncleCountByBlockHash: [ - 'eth_getUncleCountByBlockHash', - [params.blockHashParams], - 'Q', - 1, - ], - eth_getBlockTransactionCountByHash: [ - 'eth_getBlockTransactionCountByHash', - [params.blockHashParams], - 'Q', - 1, - ], - eth_getTransactionCount: [ - 'eth_getTransactionCount', - [params.addressParams, params.blockParameterParams], - 'Q', - 1, - 2, - ], - eth_getBalance: ['eth_getBalance', [params.addressParams, 'latest'], 'Q', 1, 2], - eth_estimateGas: ['eth_estimateGas', [params.estimateTransaction], 'Q', 1], - eth_getUncleCountByBlockNumber: [ - 'eth_getUncleCountByBlockNumber', - [params.blockParameterParams], - 'Q', - 1, - ], - eth_getBlockTransactionCountByNumber: [ - 'eth_getBlockTransactionCountByNumber', - ['latest'], - 'Q', - 1, - ], - eth_protocolVersion: ['eth_protocolVersion', params.param, 'S'], - eth_getCode: ['eth_getCode', params.getCodeParams, 'D', 1, 2], - }, - booleanMethods: { - // these are the methods which have output in the form of boolean - eth_uninstallFilter: ['eth_uninstallFilter', params.filterParams, 'B', 1], - eth_mining: ['eth_mining', params.param, 'B'], - eth_syncing: ['eth_syncing', params.param, 'B|EthSyncing'], - }, - transactionMethods: { - // these are the methods which have output in the form of transaction object - eth_getTransactionByHash: [ - 'eth_getTransactionByHash', - params.transactionHashParams, - params.transaction, - 1, - ], - eth_getTransactionByBlockHashAndIndex: [ - 'eth_getTransactionByBlockHashAndIndex', - params.blockHashAndIndexParams, - params.transaction, - 2, - ], - eth_getTransactionByBlockNumberAndIndex: [ - 'eth_getTransactionByBlockNumberAndIndex', - [params.blockParameterParams, '0x0'], - params.transaction, - 2, - ], - - }, - blockMethods: { - // these are the methods which have output in the form of a block - - eth_getUncleByBlockNumberAndIndex: [ - 'eth_getUncleByBlockNumberAndIndex', - params.uncleByBlockNumberAndIndexParams, - params.block, - 2, - ], - eth_getBlockByHash: [ - 'eth_getBlockByHash', - [params.params, false], - params.block, - 2, - ], - eth_getBlockByNumber: [ - 'eth_getBlockByNumber', - [params.blockParameterParams, false], - params.block, - 2, - ], - }, - - methods: { - // these are the methods which have output in the form of bytes data - - eth_call: ['eth_call', [params.estimateTransaction, 'latest'], 'D', 1, 2], - eth_getStorageAt: ['eth_getStorageAt', params.getStorageAtParams, 'D', 2, 2], - eth_getTransactionReceipt: [ - 'eth_getTransactionReceipt', - params.transactionHashParams, - params.receipt, - 1, - ], - - }, - -} - diff --git a/test/web3/web3.js b/test/web3/web3.js deleted file mode 100644 index 49898044d..000000000 --- a/test/web3/web3.js +++ /dev/null @@ -1,34 +0,0 @@ -/* eslint no-undef: 0 */ - -const json = methods - -web3.currentProvider.enable().then(() => { - - Object.keys(json).forEach((methodGroupKey) => { - - console.log(methodGroupKey) - const methodGroup = json[methodGroupKey] - console.log(methodGroup) - Object.keys(methodGroup).forEach((methodKey) => { - - const methodButton = document.getElementById(methodKey) - methodButton.addEventListener('click', () => { - - window.ethereum.sendAsync({ - method: methodKey, - params: methodGroup[methodKey][1], - }, (err, result) => { - if (err) { - console.log(err) - console.log(methodKey) - } else { - document.getElementById('results').innerHTML = JSON.stringify(result) - } - }) - }) - - }) - - }) -}) - From 8063a83d859ad18be6658e97f39990a831ec2c8b Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Fri, 7 Aug 2020 19:45:54 +0000 Subject: [PATCH 42/44] Version v8.0.7 --- CHANGELOG.md | 2 ++ app/manifest/_base.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49e998535..f5ddfb95f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Develop Branch +## 8.0.7 Fri Aug 07 2020 + ## 8.0.6 Wed Jul 22 2020 - [#9030](https://github.com/MetaMask/metamask-extension/pull/9030): Hide "delete" button when editing contact of wallet account - [#9031](https://github.com/MetaMask/metamask-extension/pull/9031): Fix crash upon removing contact diff --git a/app/manifest/_base.json b/app/manifest/_base.json index 053cb878a..962500a78 100644 --- a/app/manifest/_base.json +++ b/app/manifest/_base.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "8.0.6", + "version": "8.0.7", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", From 027723d3964730fa909af3829e8c2d3817bfe09f Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 7 Aug 2020 17:54:51 -0300 Subject: [PATCH 43/44] Update changelog for v8.0.7 (#9161) Changes that were not user-facing have been omitted, and the descriptions have been updated to be more readable for users. --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5ddfb95f..c77b4b186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ ## Current Develop Branch ## 8.0.7 Fri Aug 07 2020 +- [#9065](https://github.com/MetaMask/metamask-extension/pull/9065): Change title of "Reveal Seed Words" page to "Reveal Seed Phrase" +- [#8974](https://github.com/MetaMask/metamask-extension/pull/8974): Add tooltip to copy button for contacts and seed phrase +- [#9063](https://github.com/MetaMask/metamask-extension/pull/9063): Fix broken UI upon failed password validation +- [#9075](https://github.com/MetaMask/metamask-extension/pull/9075): Fix shifted popup notification when browser is in fullscreen on macOS +- [#9085](https://github.com/MetaMask/metamask-extension/pull/9085): Support longer text in network dropdown +- [#8873](https://github.com/MetaMask/metamask-extension/pull/8873): Fix onboarding bug where user can be asked to verify seed phrase twice +- [#9104](https://github.com/MetaMask/metamask-extension/pull/9104): Replace "Email us" button with "Contact us" button +- [#9137](https://github.com/MetaMask/metamask-extension/pull/9137): Fix bug where `accountsChanged` events stop after a dapp connection is closed. +- [#9152](https://github.com/MetaMask/metamask-extension/pull/9152): Fix network name alignment +- [#9144](https://github.com/MetaMask/metamask-extension/pull/9144): Add web3 usage metrics and prepare for web3 removal ## 8.0.6 Wed Jul 22 2020 - [#9030](https://github.com/MetaMask/metamask-extension/pull/9030): Hide "delete" button when editing contact of wallet account From 747f4bb5c3923712c8e21e990bb87c3a44185ec6 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Sat, 8 Aug 2020 20:42:36 -0700 Subject: [PATCH 44/44] Add category in eventOpts (#9164) --- app/scripts/lib/background-metametrics.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/lib/background-metametrics.js b/app/scripts/lib/background-metametrics.js index f381ea3a1..9905e115b 100644 --- a/app/scripts/lib/background-metametrics.js +++ b/app/scripts/lib/background-metametrics.js @@ -2,12 +2,14 @@ import { getBackgroundMetaMetricState } from '../../../ui/app/selectors' import { sendMetaMetricsEvent } from '../../../ui/app/helpers/utils/metametrics.util' export default function backgroundMetaMetricsEvent (metaMaskState, eventData) { + + eventData.eventOpts['category'] = 'Background' + const stateEventData = getBackgroundMetaMetricState({ metamask: metaMaskState }) if (stateEventData.participateInMetaMetrics) { sendMetaMetricsEvent({ ...stateEventData, ...eventData, - category: 'Background', currentPath: '/background', }) }