This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Description
Making fetch requests from within node has historically had "glitches" such as the underlying Socket failing with ECONNRESET. Because mongo-data-api talks to a realm app over HTTPS, it's particularly prone to this problem.
- Select a low-overhead retry library (possible list https://npmtrends.com/p-retry-vs-promise-retry-vs-retry)
- Wrap the fetch calls in retry to minimize connection errors
- Is this configuration done at the top level (
new MongoClient) or at the individual method level (.findOne(filter, options))
- Should backoff be configurable, or should we focus on defaults that make sense for a Realm App
- Create suitable mocks to simulate the socket failing