MetaMask / MetaMask/metamask-extension
MetaMask spins forever on failed options request to custom endpoint.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Describe the bug**
MetaMask does not inform the user of an error connecting to a custom endpoint, instead just spinning forever.
**To Reproduce**
Steps to reproduce the behavior:
1. Setup Parity on a cloud server and forget to set `--jsonrpc-cors=all`
2. In MetaMask, click the Network chooser dropdown and choose Custom RPC
3. Fill in details that point to Parity server.
4. Notice that the UI just spins forever.
**Expected behavior**
The UI provides a clear error and gives up.
**Browser details (please complete the following information):**
- OS: Windows 10
- Browser: Firefox
- MetaMask Version: 4.17.1
- Beta (I think)
**Additional context**
Failing to include `--jsonrpc-cors=all` on the Parity node will result in it returning `403` responses to the MetaMask OPTIONS preflight request. MetaMask appears to just retry this request indefinitely, never alerting the user about it. I had to debug the extension to even see the error in the network tab.
You can also reproduce this behavior by setting up a tiny little webserver that just responds to all OPTIONS requests with 403.
Contributor guide
Research direction
Reproduce the custom endpoint flow with an OPTIONS request returning 403, then trace the request and retry handling in the extension. Done means the UI reports a clear connection error and stops retrying indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100