Repository navigation
feat(persistence): report per-key read results on storage failures - #48015
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [7bd6fe2]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [e9b9f12]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the per-key storage diagnostics changes.
No open issues 🎉
What changed in this PR
Adds per-key storage diagnostics to MetaMask’s persistence failure reports, helping diagnose split-state read and write failures without retaining stored values.
Changes:
- Reports manifest status and readable, missing, or failed keys.
- Attaches diagnostics as Sentry extras while preserving existing error messages, tags, and fingerprints; skips probes for browser shutdown and successful-read missing-vault recovery.
- Adds unit coverage for diagnostic outcomes, reporting, and probe failures.
| File | Description |
|---|---|
shared/lib/stores/persistence-manager.ts |
Attaches diagnostic results to persistence error reports. |
shared/lib/stores/persistence-manager.test.ts |
Tests report extras, probe failures, and excluded recovery paths. |
shared/lib/stores/extension-store.ts |
Reads the manifest and classifies each listed key independently. |
shared/lib/stores/extension-store.test.ts |
Tests manifest handling and per-key outcomes without retaining values. |
shared/lib/stores/base-store.ts |
Defines diagnostic result types and an optional store method. |
Review effort: Balanced
Battambang
left a comment
There was a problem hiding this comment.
There are 3 SonarCloud issues that might be considered but non blocking.



Description
When split-state persistence fails, Sentry reports the underlying storage error but not which logical keys were readable, missing, or failed. That makes vault corruption and write failures hard to diagnose.
This PR adds a per-key diagnostic read on the existing persistence failure path and attaches the results as Sentry extras. Existing error messages, tags, and fingerprints are unchanged.
What is reported
ExtensionStore.getSplitStateReadDiagnostics()reads the split-state manifest, then each listed key on its own.readable: split-state manifest presentmissing: no array manifest (legacydata/meta)failed: unsupported storage or the manifest read threwWhere it is attached
#capturePersistenceException, forget-failed,set-failed,persist-failed, and their backup variants.Sentry extras
persistence.read_manifest_statuspersistence.read_manifest_key_countpersistence.read_manifest_error_namepersistence.read_readable_keyspersistence.read_missing_keyspersistence.read_failed_keys(Key:ErrorNameentries)Changelog
CHANGELOG entry: null
Related issues
Fixes: MWPE-319
Manual testing steps
storage.localfailure).persistence.read_*extras are present for split state.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches persistence failure telemetry and performs extra
storage.localreads on error paths near vault/keyring storage, though designed to avoid leaking stored values.Reviewed by Cursor Bugbot for commit e9b9f12. Bugbot is set up for automated code reviews on this repo. Configure here.