diff --git a/CHANGELOG.md b/CHANGELOG.md index c77b4b186..8da4dd1ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Current Develop Branch +## 8.0.8 Fri Aug 14 2020 +- [#9211](https://github.com/MetaMask/metamask-extension/pull/9211): Fix Etherscan redirect on notification click +- [#9237](https://github.com/MetaMask/metamask-extension/pull/9237): Reduce volume of web3 usage metrics +- [#9227](https://github.com/MetaMask/metamask-extension/pull/9227): Permit all-caps addresses + ## 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 diff --git a/app/manifest/_base.json b/app/manifest/_base.json index 962500a78..07f92b3b4 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.7", + "version": "8.0.8", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", diff --git a/app/scripts/lib/background-metametrics.js b/app/scripts/lib/background-metametrics.js index 9905e115b..a9baa79b7 100644 --- a/app/scripts/lib/background-metametrics.js +++ b/app/scripts/lib/background-metametrics.js @@ -1,7 +1,7 @@ import { getBackgroundMetaMetricState } from '../../../ui/app/selectors' import { sendMetaMetricsEvent } from '../../../ui/app/helpers/utils/metametrics.util' -export default function backgroundMetaMetricsEvent (metaMaskState, eventData) { +export default function backgroundMetaMetricsEvent (metaMaskState, version, eventData) { eventData.eventOpts['category'] = 'Background' @@ -10,6 +10,7 @@ export default function backgroundMetaMetricsEvent (metaMaskState, eventData) { sendMetaMetricsEvent({ ...stateEventData, ...eventData, + version, currentPath: '/background', }) } diff --git a/app/scripts/lib/createMethodMiddleware.js b/app/scripts/lib/createMethodMiddleware.js index 308cf0a99..a2b466be1 100644 --- a/app/scripts/lib/createMethodMiddleware.js +++ b/app/scripts/lib/createMethodMiddleware.js @@ -1,3 +1,6 @@ + +const recordedWeb3Usage = {} + /** * Returns a middleware that implements the following RPC methods: * - metamask_logInjectedWeb3Usage @@ -15,11 +18,17 @@ export default function createMethodMiddleware ({ origin, sendMetrics }) { const { action, name } = req.params[0] - sendMetrics({ - action, - name, - customVariables: { origin }, - }) + if (!recordedWeb3Usage[origin]) { + recordedWeb3Usage[origin] = {} + } + if (!recordedWeb3Usage[origin][name]) { + recordedWeb3Usage[origin][name] = true + sendMetrics({ + action, + name, + customVariables: { origin }, + }) + } res.result = true break diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index f9821e822..b0866ce08 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1842,13 +1842,18 @@ export default class MetamaskController extends EventEmitter { } const metamaskState = await this.getState() - backgroundMetaMetricsEvent(metamaskState, { - customVariables, - eventOpts: { - action, - name, + const version = this.platform.getVersion() + backgroundMetaMetricsEvent( + metamaskState, + version, + { + customVariables, + eventOpts: { + action, + name, + }, }, - }) + ) } //============================================================================= diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index f62ef98e4..11340c8cc 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -223,7 +223,7 @@ export default class ExtensionPlatform { } _viewOnEtherscan (txId) { - if (txId.startsWith('http://')) { + if (txId.startsWith('https://')) { extension.tabs.create({ url: txId }) } } diff --git a/ui/app/helpers/utils/metametrics.util.js b/ui/app/helpers/utils/metametrics.util.js index cf9f15720..0ffe856bf 100644 --- a/ui/app/helpers/utils/metametrics.util.js +++ b/ui/app/helpers/utils/metametrics.util.js @@ -115,6 +115,7 @@ 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.version The current version of the MetaMask extension * @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 diff --git a/ui/app/helpers/utils/util.js b/ui/app/helpers/utils/util.js index 7643519a8..a6726cdba 100644 --- a/ui/app/helpers/utils/util.js +++ b/ui/app/helpers/utils/util.js @@ -62,11 +62,11 @@ export function addressSummary (address, firstSegLength = 10, lastSegLength = 4, } export function isValidAddress (address) { - const prefixed = ethUtil.addHexPrefix(address) - if (address === '0x0000000000000000000000000000000000000000') { + if (!address || address === '0x0000000000000000000000000000000000000000') { return false } - return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) + const prefixed = address.startsWith('0X') ? address : ethUtil.addHexPrefix(address) + return (isAllOneCase(prefixed.slice(2)) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) } export function isValidDomainName (address) {