MetaMask / MetaMask/metamask-extension
UI <=> Background - Set up local storage for semi-persisted data
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Epic: Allow the UI to read state from the storage system**
https://github.com/MetaMask/metamask-extension/issues/18054
We cannot interfere with the persisted state tree, as it is used to rehydrate the controllers state on next boot, so we will need to maintain two keys of state (persisted and semi-persisted) or use session storage for the semi-persisted data. These two trees will then need to be merged into one when reading for initialization in the UI.
You can refer to this [POC](https://github.com/MetaMask/metamask-extension/pull/17635/files) for implementation.
**Tasks**:
- Insert into local storage to store semi-persisted data snapshot from background
- Retrieve saved snapshot and startApp
- Error handling of no data and calling for background for data again
Contributor guide
Research direction
Start by reading the linked epic and the referenced POC in pull request 17635. Trace the UI startup path and background snapshot flow, then implement the listed local-storage write, retrieval and startApp behavior, including no-data handling and requesting the snapshot again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100