mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
a22b3a1fc0
Summary: In most cases (and especially so on Gmail and in the inbox on generic IMAP), messages with higher UIDs are newer---and even if they aren't the newest possible messages in other generic IMAP folders, they are the most recent messages that have been moved to that folder. Our previous batching strategy unfortunately resulted in us downloading the lowest UID in each batch first, which was especially confusing when connecting a new account and having the first message pop up on the screen be a message from hours or days ago. This patch changes the batching strategy in three ways: 1. Within a batch, we process downloaded messages from highest UID to lowest UID. 2. We download batches in order of the ones containing the highest UIDs first. 3. We group together more UIDs within a single batch by ignoring charset and transfer-encoding on parts and grouping only by MIME part IDs (which is the only thing you have to pass to the IMAP FETCH command---no idea why we included this extraneous part data before, probably just convenience.) Example old grouping: batch key: '[{"id":"2","transferEncoding":"QUOTED-PRINTABLE","charset":"UTF-8","mimeType":"text/html"}]' batch UIDs: [356416,356418,356420,356423,356432,356433,356435,356436,356437,356442,356444] batch key: '[{"id":"2","transferEncoding":"QUOTED-PRINTABLE","charset":"Windows-1252","mimeType":"text/html"}]' batch UIDs: [353777] In the new strategy, all of these messages will be downloaded with the same FETCH command, reducing IMAP round trips before message processing begins. Fixes T7770 Test Plan: manual - connect a new account and see that most recent message downloads first Reviewers: mark, evan, juan Reviewed By: juan Maniphest Tasks: T7770 Differential Revision: https://phab.nylas.com/D3838 |
||
---|---|---|
.. | ||
images | ||
spec | ||
src | ||
stylesheets | ||
main.es6 | ||
package.json |