From 26b30a031dacb23cc0a8ec742ece972acdd48594 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 04:36:36 -0400 Subject: sentry - move isBrave decoration to insides of try-catch --- app/scripts/lib/setupRaven.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js index e6e511640..e1dc4bb8b 100644 --- a/app/scripts/lib/setupRaven.js +++ b/app/scripts/lib/setupRaven.js @@ -24,10 +24,11 @@ function setupRaven (opts) { const client = Raven.config(ravenTarget, { release, transport: function (opts) { - opts.data.extra.isBrave = isBrave const report = opts.data try { + // mark browser as brave or not + report.extra.isBrave = isBrave // handle error-like non-error exceptions rewriteErrorLikeExceptions(report) // simplify certain complex error messages (e.g. Ethjs) -- cgit v1.2.3 From 65aa0a1d14b0b18d77b537b216d03ce5d9fca725 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 04:51:03 -0400 Subject: blacklist - throw errors on request/parse failure --- app/scripts/controllers/blacklist.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/blacklist.js b/app/scripts/controllers/blacklist.js index 89c7cc888..5a5ec1c31 100644 --- a/app/scripts/controllers/blacklist.js +++ b/app/scripts/controllers/blacklist.js @@ -83,8 +83,23 @@ class BlacklistController { * */ async updatePhishingList () { - const response = await fetch('https://api.infura.io/v2/blacklist') - const phishing = await response.json() + // make request + let response + try { + response = await fetch('https://api.infura.io/v2/blacklist') + } catch (err) { + throw new Error(`BlacklistController - failed to fetch blacklist:\n${err.stack}`) + } + // parse response + let rawResponse + let phishing + try { + const rawResponse = await response.text() + phishing = JSON.parse(rawResponse) + } catch (err) { + throw new Error(`BlacklistController - failed to parse blacklist:\n${rawResponse}`) + } + // update current blacklist this.store.updateState({ phishing }) this._setupPhishingDetector(phishing) return phishing @@ -97,9 +112,9 @@ class BlacklistController { */ scheduleUpdates () { if (this._phishingUpdateIntervalRef) return - this.updatePhishingList().catch(log.warn) + this.updatePhishingList() this._phishingUpdateIntervalRef = setInterval(() => { - this.updatePhishingList().catch(log.warn) + this.updatePhishingList() }, POLLING_INTERVAL) } -- cgit v1.2.3 From 2394881511928e414ca99cac2a46f30a7703ae91 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 04:58:19 -0400 Subject: currency - throw errors on failure --- app/scripts/controllers/currency.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js index d5bc5fe2b..619c515fa 100644 --- a/app/scripts/controllers/currency.js +++ b/app/scripts/controllers/currency.js @@ -107,14 +107,28 @@ class CurrencyController { let currentCurrency try { currentCurrency = this.getCurrentCurrency() - const response = await fetch(`https://api.infura.io/v1/ticker/eth${currentCurrency.toLowerCase()}`) - const parsedResponse = await response.json() + let response + try { + response = await fetch(`https://api.infura.io/v1/ticker/eth${currentCurrency.toLowerCase()}`) + } catch (err) { + throw new Error(`CurrencyController - Failed to request currency from Infura:\n${err.stack}`) + } + let rawResponse + let parsedResponse + try { + rawResponse = await response.text() + parsedResponse = JSON.parse(rawResponse) + } catch () { + throw new Error(`CurrencyController - Failed to parse response "${rawResponse}"`) + } this.setConversionRate(Number(parsedResponse.bid)) this.setConversionDate(Number(parsedResponse.timestamp)) } catch (err) { - log.warn(`MetaMask - Failed to query currency conversion:`, currentCurrency, err) + // reset current conversion rate this.setConversionRate(0) this.setConversionDate('N/A') + // throw error + throw new Error(`CurrencyController - Failed to query rate for currency "${currentCurrency}":\n${err.stack}`) } } -- cgit v1.2.3 From 3e3d4b9ddef032fe81419a516e65eb62ed664cb9 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 05:30:21 -0400 Subject: sentry - failed txs - namespace txMeta for better readability --- app/scripts/lib/reportFailedTxToSentry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/reportFailedTxToSentry.js b/app/scripts/lib/reportFailedTxToSentry.js index df5661e59..fc6fbac24 100644 --- a/app/scripts/lib/reportFailedTxToSentry.js +++ b/app/scripts/lib/reportFailedTxToSentry.js @@ -11,6 +11,6 @@ function reportFailedTxToSentry ({ raven, txMeta }) { const errorMessage = 'Transaction Failed: ' + extractEthjsErrorMessage(txMeta.err.message) raven.captureMessage(errorMessage, { // "extra" key is required by Sentry - extra: txMeta, + extra: { txMeta }, }) } -- cgit v1.2.3 From b85ae55cd59b4f8fe52ec75e1b7c6efe52a02e3f Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 06:42:53 -0400 Subject: fetch debugger - only append source stack if no stack is present --- app/scripts/lib/setupFetchDebugging.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/setupFetchDebugging.js b/app/scripts/lib/setupFetchDebugging.js index dd87b65a6..c1ef22d21 100644 --- a/app/scripts/lib/setupFetchDebugging.js +++ b/app/scripts/lib/setupFetchDebugging.js @@ -2,7 +2,7 @@ module.exports = setupFetchDebugging // // This is a utility to help resolve cases where `window.fetch` throws a -// `TypeError: Failed to Fetch` without any stack or context for the request +// `TypeError: Failed to Fetch` without any stack or context for the request // https://github.com/getsentry/sentry-javascript/pull/1293 // @@ -17,9 +17,11 @@ function setupFetchDebugging() { try { return await originalFetch.call(window, ...args) } catch (err) { - console.warn('FetchDebugger - fetch encountered an Error', err) - console.warn('FetchDebugger - overriding stack to point of original call') - err.stack = initialStack + if (!err.stack) { + console.warn('FetchDebugger - fetch encountered an Error without a stack', err) + console.warn('FetchDebugger - overriding stack to point of original call') + err.stack = initialStack + } throw err } } -- cgit v1.2.3 From a57d267dcbfa1a75a5ce3295e51825561e42c58d Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 07:08:04 -0400 Subject: lint fix --- app/scripts/controllers/blacklist.js | 1 - app/scripts/controllers/currency.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/blacklist.js b/app/scripts/controllers/blacklist.js index 5a5ec1c31..6ee89259c 100644 --- a/app/scripts/controllers/blacklist.js +++ b/app/scripts/controllers/blacklist.js @@ -1,7 +1,6 @@ const ObservableStore = require('obs-store') const extend = require('xtend') const PhishingDetector = require('eth-phishing-detect/src/detector') -const log = require('loglevel') // compute phishing lists const PHISHING_DETECTION_CONFIG = require('eth-phishing-detect/src/config.json') diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js index 619c515fa..6cb39d39a 100644 --- a/app/scripts/controllers/currency.js +++ b/app/scripts/controllers/currency.js @@ -1,6 +1,5 @@ const ObservableStore = require('obs-store') const extend = require('xtend') -const log = require('loglevel') // every ten minutes const POLLING_INTERVAL = 600000 @@ -118,7 +117,7 @@ class CurrencyController { try { rawResponse = await response.text() parsedResponse = JSON.parse(rawResponse) - } catch () { + } catch (err) { throw new Error(`CurrencyController - Failed to parse response "${rawResponse}"`) } this.setConversionRate(Number(parsedResponse.bid)) -- cgit v1.2.3 From 31175dcb24d836650469775a50289bfc131bcd18 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 19 Oct 2018 07:18:16 -0400 Subject: blacklist + currency - report error via log instead of throw --- app/scripts/controllers/blacklist.js | 7 +++++-- app/scripts/controllers/currency.js | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/blacklist.js b/app/scripts/controllers/blacklist.js index 6ee89259c..e55b09d03 100644 --- a/app/scripts/controllers/blacklist.js +++ b/app/scripts/controllers/blacklist.js @@ -1,6 +1,7 @@ const ObservableStore = require('obs-store') const extend = require('xtend') const PhishingDetector = require('eth-phishing-detect/src/detector') +const log = require('loglevel') // compute phishing lists const PHISHING_DETECTION_CONFIG = require('eth-phishing-detect/src/config.json') @@ -87,7 +88,8 @@ class BlacklistController { try { response = await fetch('https://api.infura.io/v2/blacklist') } catch (err) { - throw new Error(`BlacklistController - failed to fetch blacklist:\n${err.stack}`) + log.error(new Error(`BlacklistController - failed to fetch blacklist:\n${err.stack}`)) + return } // parse response let rawResponse @@ -96,7 +98,8 @@ class BlacklistController { const rawResponse = await response.text() phishing = JSON.parse(rawResponse) } catch (err) { - throw new Error(`BlacklistController - failed to parse blacklist:\n${rawResponse}`) + log.error(new Error(`BlacklistController - failed to parse blacklist:\n${rawResponse}`)) + return } // update current blacklist this.store.updateState({ phishing }) diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js index 6cb39d39a..6b82265f6 100644 --- a/app/scripts/controllers/currency.js +++ b/app/scripts/controllers/currency.js @@ -1,5 +1,6 @@ const ObservableStore = require('obs-store') const extend = require('xtend') +const log = require('loglevel') // every ten minutes const POLLING_INTERVAL = 600000 @@ -110,7 +111,8 @@ class CurrencyController { try { response = await fetch(`https://api.infura.io/v1/ticker/eth${currentCurrency.toLowerCase()}`) } catch (err) { - throw new Error(`CurrencyController - Failed to request currency from Infura:\n${err.stack}`) + log.error(new Error(`CurrencyController - Failed to request currency from Infura:\n${err.stack}`)) + return } let rawResponse let parsedResponse @@ -118,7 +120,8 @@ class CurrencyController { rawResponse = await response.text() parsedResponse = JSON.parse(rawResponse) } catch (err) { - throw new Error(`CurrencyController - Failed to parse response "${rawResponse}"`) + log.error(new Error(`CurrencyController - Failed to parse response "${rawResponse}"`)) + return } this.setConversionRate(Number(parsedResponse.bid)) this.setConversionDate(Number(parsedResponse.timestamp)) @@ -127,7 +130,8 @@ class CurrencyController { this.setConversionRate(0) this.setConversionDate('N/A') // throw error - throw new Error(`CurrencyController - Failed to query rate for currency "${currentCurrency}":\n${err.stack}`) + log.error(new Error(`CurrencyController - Failed to query rate for currency "${currentCurrency}":\n${err.stack}`)) + return } } -- cgit v1.2.3 From e3fda83ab209af7836ba93bfaba215c271d73e8a Mon Sep 17 00:00:00 2001 From: kumavis Date: Sat, 20 Oct 2018 02:22:50 -0400 Subject: sentry - replace raven-js with sentry/browser --- app/scripts/background.js | 12 ++-- app/scripts/lib/reportFailedTxToSentry.js | 4 +- app/scripts/lib/setupRaven.js | 101 ------------------------------ app/scripts/lib/setupSentry.js | 91 +++++++++++++++++++++++++++ app/scripts/ui.js | 4 +- 5 files changed, 101 insertions(+), 111 deletions(-) delete mode 100644 app/scripts/lib/setupRaven.js create mode 100644 app/scripts/lib/setupSentry.js (limited to 'app') diff --git a/app/scripts/background.js b/app/scripts/background.js index 509a0001d..2455608aa 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -23,7 +23,7 @@ const createStreamSink = require('./lib/createStreamSink') const NotificationManager = require('./lib/notification-manager.js') const MetamaskController = require('./metamask-controller') const rawFirstTimeState = require('./first-time-state') -const setupRaven = require('./lib/setupRaven') +const setupSentry = require('./lib/setupSentry') const reportFailedTxToSentry = require('./lib/reportFailedTxToSentry') const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') const EdgeEncryptor = require('./edge-encryptor') @@ -50,7 +50,7 @@ global.METAMASK_NOTIFIER = notificationManager // setup sentry error reporting const release = platform.getVersion() -const raven = setupRaven({ release }) +const sentry = setupSentry({ release }) // browser check if it is Edge - https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser // Internet Explorer 6-11 @@ -197,14 +197,14 @@ async function loadStateFromPersistence () { // we were able to recover (though it might be old) versionedData = diskStoreState const vaultStructure = getObjStructure(versionedData) - raven.captureMessage('MetaMask - Empty vault found - recovered from diskStore', { + sentry.captureMessage('MetaMask - Empty vault found - recovered from diskStore', { // "extra" key is required by Sentry extra: { vaultStructure }, }) } else { // unable to recover, clear state versionedData = migrator.generateInitialState(firstTimeState) - raven.captureMessage('MetaMask - Empty vault found - unable to recover') + sentry.captureMessage('MetaMask - Empty vault found - unable to recover') } } @@ -212,7 +212,7 @@ async function loadStateFromPersistence () { migrator.on('error', (err) => { // get vault structure without secrets const vaultStructure = getObjStructure(versionedData) - raven.captureException(err, { + sentry.captureException(err, { // "extra" key is required by Sentry extra: { vaultStructure }, }) @@ -279,7 +279,7 @@ function setupController (initState, initLangCode) { if (status !== 'failed') return const txMeta = controller.txController.txStateManager.getTx(txId) try { - reportFailedTxToSentry({ raven, txMeta }) + reportFailedTxToSentry({ sentry, txMeta }) } catch (e) { console.error(e) } diff --git a/app/scripts/lib/reportFailedTxToSentry.js b/app/scripts/lib/reportFailedTxToSentry.js index fc6fbac24..de4d57145 100644 --- a/app/scripts/lib/reportFailedTxToSentry.js +++ b/app/scripts/lib/reportFailedTxToSentry.js @@ -7,9 +7,9 @@ module.exports = reportFailedTxToSentry // for sending to sentry // -function reportFailedTxToSentry ({ raven, txMeta }) { +function reportFailedTxToSentry ({ sentry, txMeta }) { const errorMessage = 'Transaction Failed: ' + extractEthjsErrorMessage(txMeta.err.message) - raven.captureMessage(errorMessage, { + sentry.captureMessage(errorMessage, { // "extra" key is required by Sentry extra: { txMeta }, }) diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js deleted file mode 100644 index e1dc4bb8b..000000000 --- a/app/scripts/lib/setupRaven.js +++ /dev/null @@ -1,101 +0,0 @@ -const Raven = require('raven-js') -const METAMASK_DEBUG = process.env.METAMASK_DEBUG -const extractEthjsErrorMessage = require('./extractEthjsErrorMessage') -const PROD = 'https://3567c198f8a8412082d32655da2961d0@sentry.io/273505' -const DEV = 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496' - -module.exports = setupRaven - -// Setup raven / sentry remote error reporting -function setupRaven (opts) { - const { release } = opts - let ravenTarget - // detect brave - const isBrave = Boolean(window.chrome.ipcRenderer) - - if (METAMASK_DEBUG) { - console.log('Setting up Sentry Remote Error Reporting: DEV') - ravenTarget = DEV - } else { - console.log('Setting up Sentry Remote Error Reporting: PROD') - ravenTarget = PROD - } - - const client = Raven.config(ravenTarget, { - release, - transport: function (opts) { - const report = opts.data - - try { - // mark browser as brave or not - report.extra.isBrave = isBrave - // handle error-like non-error exceptions - rewriteErrorLikeExceptions(report) - // simplify certain complex error messages (e.g. Ethjs) - simplifyErrorMessages(report) - // modify report urls - rewriteReportUrls(report) - } catch (err) { - console.warn(err) - } - // make request normally - client._makeRequest(opts) - }, - }) - client.install() - - return Raven -} - -function rewriteErrorLikeExceptions (report) { - // handle errors that lost their error-ness in serialization (e.g. dnode) - rewriteErrorMessages(report, (errorMessage) => { - if (!errorMessage.includes('Non-Error exception captured with keys:')) return errorMessage - if (!(report.extra && report.extra.__serialized__ && report.extra.__serialized__.message)) return errorMessage - return `Non-Error Exception: ${report.extra.__serialized__.message}` - }) -} - -function simplifyErrorMessages (report) { - rewriteErrorMessages(report, (errorMessage) => { - // simplify ethjs error messages - errorMessage = extractEthjsErrorMessage(errorMessage) - // simplify 'Transaction Failed: known transaction' - if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) { - // cut the hash from the error message - errorMessage = 'Transaction Failed: known transaction' - } - return errorMessage - }) -} - -function rewriteErrorMessages (report, rewriteFn) { - // rewrite top level message - if (typeof report.message === 'string') report.message = rewriteFn(report.message) - // rewrite each exception message - if (report.exception && report.exception.values) { - report.exception.values.forEach(item => { - if (typeof item.value === 'string') item.value = rewriteFn(item.value) - }) - } -} - -function rewriteReportUrls (report) { - // update request url - report.request.url = toMetamaskUrl(report.request.url) - // update exception stack trace - if (report.exception && report.exception.values) { - report.exception.values.forEach(item => { - item.stacktrace.frames.forEach(frame => { - frame.filename = toMetamaskUrl(frame.filename) - }) - }) - } -} - -function toMetamaskUrl (origUrl) { - const filePath = origUrl.split(location.origin)[1] - if (!filePath) return origUrl - const metamaskUrl = `metamask${filePath}` - return metamaskUrl -} diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js new file mode 100644 index 000000000..aa8d72194 --- /dev/null +++ b/app/scripts/lib/setupSentry.js @@ -0,0 +1,91 @@ +const Sentry = require('@sentry/browser') +const METAMASK_DEBUG = process.env.METAMASK_DEBUG +const extractEthjsErrorMessage = require('./extractEthjsErrorMessage') +const SENTRY_DSN_PROD = 'https://3567c198f8a8412082d32655da2961d0@sentry.io/273505' +const SENTRY_DSN_DEV = 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496' + +module.exports = setupSentry + +// Setup sentry remote error reporting +function setupSentry (opts) { + const { release } = opts + let sentryTarget + // detect brave + const isBrave = Boolean(window.chrome.ipcRenderer) + + if (METAMASK_DEBUG) { + console.log('Setting up Sentry Remote Error Reporting: SENTRY_DSN_DEV') + sentryTarget = SENTRY_DSN_DEV + } else { + console.log('Setting up Sentry Remote Error Reporting: SENTRY_DSN_PROD') + sentryTarget = SENTRY_DSN_PROD + } + + Sentry.init({ + dsn: sentryTarget, + debug: METAMASK_DEBUG, + release, + beforeSend: (report) => rewriteReport(report), + }) + + Sentry.configureScope(scope => { + scope.setExtra('isBrave', isBrave) + }) + + function rewriteReport(report) { + try { + // simplify certain complex error messages (e.g. Ethjs) + simplifyErrorMessages(report) + // modify report urls + rewriteReportUrls(report) + } catch (err) { + console.warn(err) + } + } + + return Sentry +} + +function simplifyErrorMessages (report) { + rewriteErrorMessages(report, (errorMessage) => { + // simplify ethjs error messages + errorMessage = extractEthjsErrorMessage(errorMessage) + // simplify 'Transaction Failed: known transaction' + if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) { + // cut the hash from the error message + errorMessage = 'Transaction Failed: known transaction' + } + return errorMessage + }) +} + +function rewriteErrorMessages (report, rewriteFn) { + // rewrite top level message + if (typeof report.message === 'string') report.message = rewriteFn(report.message) + // rewrite each exception message + if (report.exception && report.exception.values) { + report.exception.values.forEach(item => { + if (typeof item.value === 'string') item.value = rewriteFn(item.value) + }) + } +} + +function rewriteReportUrls (report) { + // update request url + report.request.url = toMetamaskUrl(report.request.url) + // update exception stack trace + if (report.exception && report.exception.values) { + report.exception.values.forEach(item => { + item.stacktrace.frames.forEach(frame => { + frame.filename = toMetamaskUrl(frame.filename) + }) + }) + } +} + +function toMetamaskUrl (origUrl) { + const filePath = origUrl.split(location.origin)[1] + if (!filePath) return origUrl + const metamaskUrl = `metamask${filePath}` + return metamaskUrl +} diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 98a036338..8893ceaad 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -9,7 +9,7 @@ const extension = require('extensionizer') const ExtensionPlatform = require('./platforms/extension') const NotificationManager = require('./lib/notification-manager') const notificationManager = new NotificationManager() -const setupRaven = require('./lib/setupRaven') +const setupSentry = require('./lib/setupSentry') const log = require('loglevel') start().catch(log.error) @@ -21,7 +21,7 @@ async function start () { // setup sentry error reporting const release = global.platform.getVersion() - setupRaven({ release }) + setupSentry({ release }) // inject css // const css = MetaMaskUiCss() -- cgit v1.2.3 From 73ec4e66cb7a476d01371a61692b0d8d9224da04 Mon Sep 17 00:00:00 2001 From: kumavis Date: Sat, 20 Oct 2018 03:14:59 -0400 Subject: sentry - include app state in ui errors --- app/scripts/lib/setupSentry.js | 8 +++++++- app/scripts/ui.js | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index aa8d72194..69042bc19 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -8,7 +8,7 @@ module.exports = setupSentry // Setup sentry remote error reporting function setupSentry (opts) { - const { release } = opts + const { release, getState } = opts let sentryTarget // detect brave const isBrave = Boolean(window.chrome.ipcRenderer) @@ -38,9 +38,15 @@ function setupSentry (opts) { simplifyErrorMessages(report) // modify report urls rewriteReportUrls(report) + // append app state + if (getState) { + const appState = getState() + report.extra.appState = appState + } } catch (err) { console.warn(err) } + return report } return Sentry diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 8893ceaad..c4f6615db 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -21,7 +21,17 @@ async function start () { // setup sentry error reporting const release = global.platform.getVersion() - setupSentry({ release }) + setupSentry({ release, getState }) + // provide app state to append to error logs + function getState() { + // get app state + const state = window.getCleanAppState() + // remove unnecessary data + delete state.localeMessages + delete state.metamask.recentBlocks + // return state to be added to request + return state + } // inject css // const css = MetaMaskUiCss() -- cgit v1.2.3