MetaMask / MetaMask/metamask-extension
[State Sync Redesign 3.10] Update Sentry state capture chain
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
The Sentry error reporting chain reads state.metamask at multiple points. Must be updated before the slice is removed, or production error visibility is lost.
Current chain:
ui/index.js: getSentryAppState → maskObject(store.getState(), SENTRY_UI_STATE)
app/scripts/constants/sentry-state.ts: SENTRY_UI_STATE = { metamask: flattenedBackgroundStateMask }
app/scripts/lib/setupSentry.js: getMetaMetricsEnabledFromAppState → appState.state.metamask.participateInMetaMetrics
app/scripts/lib/setup-initial-state-hooks.js: wires getSentryState pre- and post-init
Steps
- Update
getSentryAppStateinui/index.jsto build state fromControllerStateManagersnapshots + Redux (non-metamask slices) - Update
SENTRY_UI_STATEmask insentry-state.tsto use controller-keyed shape (aligning with the background'sSENTRY_BACKGROUND_STATEwhich is already controller-keyed) - Update
getMetaMetricsEnabledFromAppStateinsetupSentry.jsto read from controller-keyed path (MetaMetricsController.participateInMetaMetrics) - Update
setup-initial-state-hooks.jswiring - Validate: trigger a Sentry error in dev, confirm the masked state payload is correct
Files
ui/index.jsapp/scripts/constants/sentry-state.tsapp/scripts/lib/setupSentry.jsapp/scripts/lib/setup-initial-state-hooks.js
Risk
High — if Sentry breaks, we lose production error visibility. Must be validated before and after slice removal.
Dependencies
Issue 3.9 (dual-write removed, but Sentry update can start during dual-write phase)
Context
Part of [State Sync Redesign — Epic 3: UI-controller subscriptions].
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with getSentryAppState in ui/index.js, then compare sentry-state.ts with the controller-keyed SENTRY_BACKGROUND_STATE. Trace the MetaMetrics lookup in setupSentry.js and the wiring in setup-initial-state-hooks.js. Done means the four files use controller-keyed state and a dev Sentry error shows the correct masked payload before and after slice removal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, observability
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100