Mailspring/packages
Juan Tejada 07d576d5f4 [client-app] Fix delta streaming connection retries
Summary:
Previously, every time our NylasLongConnection changed its status to
`connected`, we would reset our backoff scheduler, assuming that
every time our status changed to `connected` it meant that we would not
receive any errors.

However, if our backend is down or overloaded (or returning 401s like in
our recent outage), we would do the following:

1. Establish connection, change status to `connected`
2. Reset backoff scheduler
3. Receive error
4. Close connection
5. Schedule next retry using backoff scheduler. Delay will be 1s or less, because scheduler was reset in 2.
6. Retry after delay,
7. Repeat from 1., ad infinitum

This caused us to consistantly hammer our servers and render our
exponential backoff useless.

This commit makes it so we conly reset the backoff scheduler when we
actually receive deltas, and increments the max backoff to 10 minutes

Test Plan:
run against local n1Cloud, manually return 401s from the api, verify that we
didn't backoff at all before this diff, verify that we backoff correctly after
this diff

Reviewers: mark, spang, halla

Reviewed By: mark, spang, halla

Differential Revision: https://phab.nylas.com/D4401
2017-04-10 15:08:48 -07:00
..
client-app [client-app] Fix delta streaming connection retries 2017-04-10 15:08:48 -07:00
client-sync [client-app] Add benchmark mode 2017-04-07 15:33:57 -07:00
isomorphic-core [isomorphic-core] Handle weird MIME edge case with @ symbol 2017-04-10 12:40:22 -07:00
README.md [*] Rename postinstall.js -> postinstall.es6 2017-02-21 15:55:08 -08:00

Monorepo Packages

Each folder here is designed to act as its own repository. For development convenience, they are all included here in one monorepo. This allows us to grep across multiple codebases, not use submodules, and keep a unified commit history.

We use Lerna to manage the monorepo and tie them all together with the main nylas-mail-all/scripts/postinstall.es6 script, which in turn, calls lerna bootstrap