1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00
metamask-extension/app/scripts
Mark Stacey 885a8ce256
Fix Sentry breadcrumb collection during initialization (again) (#20532)
Sentry breadcrumb collection during initialization was broken in #20529
because we failed to consider that the `getSentryState` check was also
used for an opt-in check in the `beforeBreadcrumb` hook.

I had assumed that `getSentryState` was only used to get state to add
additional context to an error report. But the function has a second
purpose: to get state for the purposes of checking whether the user has
opted into MetaMetrics. In this second case, `mostRecentRetrievedState`
is sometimes unset (which violates an assumption made in #20529)

The `getMostRecentPersistedState` hook removed in #20529 has been
restored, ensuring that the `getSentryState` function returns Sentry
state after loading state for the first time, but before the first
error has occurred.

This mistake didn't cause e2e tests to fail because multiple errors are
currently thrown in the background upon initialization on `develop`
(relating to Snow scuttling). These errors were early enough that they
happened before the console logs that our breadcrumb test was testing
for. When #20529 was ported onto the v10.34.5 RC, these errors were not
present so the test failed correctly.
2023-08-18 18:26:27 -02:30
..
constants
controllers [MMI] Set approved status in tx controller in MMI logic (#20507) 2023-08-18 14:38:51 +02:00
lib Fix Sentry breadcrumb collection during initialization (again) (#20532) 2023-08-18 18:26:27 -02:30
migrations Remove invalid tokensChainsCache state (#20495) 2023-08-17 09:04:30 -02:30
platforms
app-init.js
background.js Fix Sentry breadcrumb collection during initialization (again) (#20532) 2023-08-18 18:26:27 -02:30
contentscript.js
detect-multiple-instances.js
detect-multiple-instances.test.js
disable-console.js
first-time-state.js
init-globals.js
inpage.js
lockdown-more.js
lockdown-run.js
metamask-controller.actions.test.js
metamask-controller.js Track usage of snap exports (#20503) 2023-08-17 16:13:40 +02:00
metamask-controller.test.js
mmi-keyring-builder-factory.js
sentry-install.js
translate.test.ts
translate.ts
ui.js Fix pre-initialization UI error state capture (#20529) 2023-08-18 16:32:28 -02:30
use-snow.js