|
|
@ -23,7 +23,7 @@ const createStreamSink = require('./lib/createStreamSink') |
|
|
|
const NotificationManager = require('./lib/notification-manager.js') |
|
|
|
const NotificationManager = require('./lib/notification-manager.js') |
|
|
|
const MetamaskController = require('./metamask-controller') |
|
|
|
const MetamaskController = require('./metamask-controller') |
|
|
|
const rawFirstTimeState = require('./first-time-state') |
|
|
|
const rawFirstTimeState = require('./first-time-state') |
|
|
|
const setupRaven = require('./lib/setupRaven') |
|
|
|
const setupSentry = require('./lib/setupSentry') |
|
|
|
const reportFailedTxToSentry = require('./lib/reportFailedTxToSentry') |
|
|
|
const reportFailedTxToSentry = require('./lib/reportFailedTxToSentry') |
|
|
|
const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') |
|
|
|
const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics') |
|
|
|
const EdgeEncryptor = require('./edge-encryptor') |
|
|
|
const EdgeEncryptor = require('./edge-encryptor') |
|
|
@ -50,7 +50,7 @@ global.METAMASK_NOTIFIER = notificationManager |
|
|
|
|
|
|
|
|
|
|
|
// setup sentry error reporting
|
|
|
|
// setup sentry error reporting
|
|
|
|
const release = platform.getVersion() |
|
|
|
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
|
|
|
|
// 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
|
|
|
|
// Internet Explorer 6-11
|
|
|
@ -197,14 +197,14 @@ async function loadStateFromPersistence () { |
|
|
|
// we were able to recover (though it might be old)
|
|
|
|
// we were able to recover (though it might be old)
|
|
|
|
versionedData = diskStoreState |
|
|
|
versionedData = diskStoreState |
|
|
|
const vaultStructure = getObjStructure(versionedData) |
|
|
|
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" key is required by Sentry
|
|
|
|
extra: { vaultStructure }, |
|
|
|
extra: { vaultStructure }, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// unable to recover, clear state
|
|
|
|
// unable to recover, clear state
|
|
|
|
versionedData = migrator.generateInitialState(firstTimeState) |
|
|
|
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) => { |
|
|
|
migrator.on('error', (err) => { |
|
|
|
// get vault structure without secrets
|
|
|
|
// get vault structure without secrets
|
|
|
|
const vaultStructure = getObjStructure(versionedData) |
|
|
|
const vaultStructure = getObjStructure(versionedData) |
|
|
|
raven.captureException(err, { |
|
|
|
sentry.captureException(err, { |
|
|
|
// "extra" key is required by Sentry
|
|
|
|
// "extra" key is required by Sentry
|
|
|
|
extra: { vaultStructure }, |
|
|
|
extra: { vaultStructure }, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -279,7 +279,7 @@ function setupController (initState, initLangCode) { |
|
|
|
if (status !== 'failed') return |
|
|
|
if (status !== 'failed') return |
|
|
|
const txMeta = controller.txController.txStateManager.getTx(txId) |
|
|
|
const txMeta = controller.txController.txStateManager.getTx(txId) |
|
|
|
try { |
|
|
|
try { |
|
|
|
reportFailedTxToSentry({ raven, txMeta }) |
|
|
|
reportFailedTxToSentry({ sentry, txMeta }) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.error(e) |
|
|
|
console.error(e) |
|
|
|
} |
|
|
|
} |
|
|
|