MetaMask / MetaMask/eth-ledger-bridge-keyring
Sometimes messages to injected iframe don't get a reply
- Dominant language
- TypeScript
- Stars
- 84
- Forks
- 122
- PR merge metrics
- No merged PRs in 30d
Description
When we send a message to the injected iframe, we attach a message handler that waits for a reply, assuming that the only reply will be the one that it expects. If it receives a different reply than expected, the message handler is removed and the callback is never called, leaving that method pending forever. This can happen when making multiple calls to the keyring in quick succession.
We should keep the reply listener attached until we see a reply, and ignore unexpected messages that might be responses to different calls. We should also consider adding a timeout, in case the reply never comes.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the injected iframe message handler and how concurrent keyring calls register their reply listeners. Reproduce multiple calls in quick succession, then verify that unexpected replies do not end the wait and that each callback eventually resolves; determine and test the intended behavior when no reply arrives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100