MetaMask / MetaMask/metamask-extension

Storage Resilience E4: Zero Controller Writes While Idle

Open
#44,253 3 comments 0 reactions 1 assignee Claimed by @MajorLift View on GitHub
epic for-migration mig-epic-67-child ta-triaged team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### What is this about?

## Goal
Eliminate idle-time writes — pure risk, zero user benefit.

## Why
Any write while there's no open UI, no pending network, and no queued transaction is a bug, and adds LevelDB churn precisely when the user has no reason to be at risk. (H7 — high)

## Success criteria
- Every write is tagged with an "idle" flag when the extension is idle (by a defined heuristic).
- Backlog of idle-write bugs opened per owning team.
- Target: **zero** idle writes in nightly telemetry within one quarter of instrumentation shipping.

## Tasks
- [ ] Define "idle" formally (proposal: no open popup/fullscreen/sidepanel + no pending TXs + no dapp RPC in the last 30s).
- [ ] (Instrumentation to tag writes with `is-idle` + originating controller lands in **E0**.)
- [ ] Ship a Sentry breadcrumb / metric for idle writes; wire into an internal dashboard.
- [ ] Triage the first wave of idle-write reports; open per-team follow-ups.
- [ ] Add a lint / architectural test that flags new direct `storage.local` writes bypassing `PersistenceManager`.

## Dependencies
- **Depends on:** E0 (idle-write instrumentation).

### Scenario

_No response_

### Design

_No response_

### Technical Details

_No response_

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.