Mailspring/packages/local-sync/src
Juan Tejada 5810bb6b79 [local-sync] Fix issue with imap connection mail event
Summary:
See https://github.com/mscdex/node-imap/issues/585 for details.

This issue was causing us constantly run the sync loop without pauses,
i.e. every next sync loop was scheduled immediately.

Currently, when we receive a new `'mail'`event, we trigger a new sync loop. Previously, when this happened while a sync loop was already in progress we would just ignore the event. However, my recent patch keeps track of how many times we tried to start a sync loop while one was already in progress. If the number of times this happens is > 0, it will schedule the next sync loop immediately (as opposed to waiting a constant amount seconds before the next loop).

The problem is that this new logic is making the sync worker always schedule the next sync loop immediately (without pausing for a few seconds). This is due to the following chain of events (assume we are just syncing `all` and `trash` folders):

This commit is a temporary workaround to this problem.

Test Plan: manual

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3537
2016-12-19 08:08:59 -08:00
..
local-api [local-api] fix validation errors on send 2016-12-16 18:29:52 -05:00
local-sync-dashboard [local-sync] Ship first sync metrics to honeycomb 2016-12-01 14:23:52 -08:00
local-sync-worker [local-sync] Fix issue with imap connection mail event 2016-12-19 08:08:59 -08:00
models [local-sync] Fix issue with imap connection mail event 2016-12-19 08:08:59 -08:00
new-message-processor [local-sync, cloud-api, cloud-workers] Fix msg id collision, tracking and sending issues, some refactoring 2016-12-14 19:35:48 -08:00
shared [local-sync] Ensure send runs fast, clean up multisend tasks 2016-12-16 14:41:20 -08:00