[local-sync] fix changedsince highestmodseq causing N1 crash

Since we weren't giving Node IMAP the proper format for the changedsince
flag, and since node IMAP never warned of improper schemas, we weren't
properly requesting the correct range. This would cause us to request the
metadata attributes of EVERY message in the mailbox and attempt to store
them in a hash. This would eventually lead to a memory leak and take down
the worker window, which caused other subtle issues like sends failing
when the worker window dropped task half way through their perform remotes
and never re-sent the deltas notifying of their success or failure.

This was only triggered when new highestmodseq numbers fired on the remote
server, which would be triggered by the underlying mailbox getting folders
or labels changed on messages
This commit is contained in:
Evan Morikawa 2017-01-09 14:04:04 -08:00
parent 7073e19fe7
commit 73db7a4e46

View file

@ -357,7 +357,8 @@ class FetchMessagesInFolder extends SyncOperation {
// this._logger.info('FetchMessagesInFolder: highestmodseq matches, nothing more to fetch')
return Promise.resolve();
}
shallowFetch = this._box.fetchUIDAttributes(`1:*`, {changedsince: highestmodseq});
shallowFetch = this._box.fetchUIDAttributes(`1:*`,
{modifiers: {changedsince: highestmodseq}});
} else {
const range = `${this._getLowerBoundUID(SHALLOW_SCAN_UID_COUNT)}:*`;
// this._logger.info({range}, `FetchMessagesInFolder: Shallow attribute scan`)