MetaMask / MetaMask/metamask-extension
Ensure background only sends accountsChanged notifications to inpage provider when necessary
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
Currently, the background liberally sends `accountsChanged` notifications to the [inpage provider](https://github.com/MetaMask/metamask-inpage-provider), sometimes when they aren't warranted. False positives are handled by the inpage provider, which will not emit an `accountsChanged` event if the accounts received via the notification `deepEqual` the last ones it received.
As part of the effort to make our inpage provider as minimal as possible, we should implement this check in the background instead, and remove it from the inpage provider.
Contributor guide
Research direction
Start by tracing where the background sends accountsChanged notifications and review the linked inpage provider behavior, especially its deepEqual handling. The work is done when the background suppresses notifications for unchanged accounts and the redundant check is removed from the inpage provider.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100