Mailspring/packages/local-sync
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
..
images [dashboard] Put dashboard into work window 2016-11-28 18:02:42 -08:00
spec [local-sync] Fix parseFromImap specs 2016-12-16 14:42:26 -08:00
src [local-sync] Fix issue with imap connection mail event 2016-12-19 08:08:59 -08:00
stylesheets [💄] fix eslint issues before they get overwhelming 2016-12-01 15:37:48 -08:00
main.es6 [dashboard] Put dashboard into work window 2016-11-28 18:02:42 -08:00
package.json [local-sync] fix missing dependency 2016-12-15 17:04:51 -05:00