MetaMask / MetaMask/metamask-extension
Remove MetaSwap Liveliness Polling
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
Per: https://www.notion.so/airswap/Reduce-featureFlag-load-0fd49db2f87641cda7600c33b3eae9af
The `/featureFlag` endpoint of MetaSwap is bogging down MetaSwap's logging due the 10 minute polling done here:
https://github.com/MetaMask/metamask-extension/blob/develop/app/scripts/controllers/swaps.js#L635-L723
The MetaSwap team has asked us to remove this polling. Since we check the feature flag via `fetchSwapsFeatureLiveness()` at the time we request a quote, this polling appears to be unnecessary. This code does give us online/offline event support, so maybe we can more efficiently get liveliness data.
Contributor guide
Research direction
Start by reading app/scripts/controllers/swaps.js around lines 635-723 and trace the existing 10-minute polling alongside fetchSwapsFeatureLiveness(). Confirm how quote requests check the feature flag and how online/offline events are used; done means removing the unnecessary polling while preserving the required liveness behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100