mirror of
https://github.com/moparisthebest/mail
synced 2024-11-29 12:22:22 -05:00
fix bug when uid smaller than max uid in memory exists on imap
This commit is contained in:
parent
8973c3e2b3
commit
6a8bb527fc
@ -437,12 +437,6 @@ define(function(require) {
|
||||
var inMemoryUids = _.pluck(folder.messages, 'uid'),
|
||||
delta4 = _.difference(inImapUids, inMemoryUids);
|
||||
|
||||
// no delta, we're done here
|
||||
if (_.isEmpty(delta4)) {
|
||||
doDeltaF4();
|
||||
return;
|
||||
}
|
||||
|
||||
// eliminate uids smaller than the biggest local uid, i.e. just fetch everything
|
||||
// that came in AFTER the most recent email we have in memory. Keep in mind that
|
||||
// uids are strictly ascending, so there can't be a NEW mail in the mailbox with a
|
||||
@ -456,6 +450,12 @@ define(function(require) {
|
||||
});
|
||||
}
|
||||
|
||||
// no delta, we're done here
|
||||
if (_.isEmpty(delta4)) {
|
||||
doDeltaF4();
|
||||
return;
|
||||
}
|
||||
|
||||
self._imapListMessages({
|
||||
folder: folder.path,
|
||||
firstUid: Math.min.apply(null, delta4),
|
||||
|
@ -1476,7 +1476,7 @@ define(function(require) {
|
||||
imapSearchStub = sinon.stub(dao, '_imapSearch');
|
||||
imapSearchStub.withArgs({
|
||||
folder: folder
|
||||
}).yields(null, [dummyEncryptedMail.uid]);
|
||||
}).yields(null, [dummyEncryptedMail.uid - 10, dummyEncryptedMail.uid]);
|
||||
imapSearchStub.withArgs({
|
||||
folder: folder,
|
||||
unread: true
|
||||
|
Loading…
Reference in New Issue
Block a user