|
|
|
@ -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) |
|
|
|
|
} |
|
|
|
|