Mailspring/packages/local-sync
Christine Spang 70a4b0fdcf [local-sync] Fetch min UID in each folder for use in sync state
Summary:
Currently, our mail sync strategy of expanding UID ranges from UIDNEXT
backwards until a UID of 1 implicitly assumes that every UID corresponds to an
actual message. This assumption is incorrect, and results in several
significant bugs regarding sync status.

This patch fixes issue 1:

Since UIDs are persistent and, so long as the UIDVALIDITY is valid, ascend
monotonically upward, every time you move a message to a new folder you "lose"
UIDs lower down in the range. In my work Inbox, where I get a lot of mail,
archive all the time, and generally have only a small number of threads in the
mailbox, the smallest UID is over 100k.  This means that, after all my inbox
messages are synced, the sync loop will continue attempting to download
nonexistent old messages in this mailbox for hundreds of sync iterations, and
will not mark the mailbox as fully synced until fetchmin reaches 1, regardless
of the fact that there are no actually messages being pulled down.

This patch needs a small associated patch to N1 to update how sync status is
calculated (coming soon).

The next patch in this series will deal with gaps in the UIDspace that slow
down syncing of a folder.

Test Plan: manual

Reviewers: halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3677
2017-01-14 14:52:35 -08:00
..
images [dashboard] Put dashboard into work window 2016-11-28 18:02:42 -08:00
spec [local-sync] For generic IMAP, Thread based on Message-Id, In-Reply-To & References 2017-01-13 10:39:54 -08:00
src [local-sync] Fetch min UID in each folder for use in sync state 2017-01-14 14:52:35 -08:00
stylesheets [💄] fix eslint issues before they get overwhelming 2016-12-01 15:37:48 -08:00
main.es6 [local-sync] Cleanup sync tasks to be more consistent with syncback tasks 2017-01-13 12:30:43 -08:00
package.json Update Nylas N1 to Nylas Mail 2017-01-12 11:25:39 -08:00