1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-26 10:52:17 -05:00

Fix corner case where email does not have modseq attribute

This commit is contained in:
Felix Hammerl 2014-11-18 16:33:09 +01:00
parent 906909fd7d
commit eabdeaf888

View File

@ -1171,14 +1171,14 @@ EmailDAO.prototype.onConnect = function(options, callback) {
}); });
lastUid = uids[uids.length - 1]; lastUid = uids[uids.length - 1];
highestModseq = _.pluck(folder.messages, 'modseq').sort(function(a, b) { highestModseq = (_.pluck(folder.messages, 'modseq').sort(function(a, b) {
// We treat modseq values as numbers here as an exception, should // We treat modseq values as numbers here as an exception, should
// be strings everywhere else. // be strings everywhere else.
// If it turns out that someone actually uses 64 bit uint numbers // If it turns out that someone actually uses 64 bit uint numbers
// that do not fit to the JavaScript number type then we should // that do not fit to the JavaScript number type then we should
// use a helper for handling big integers. // use a helper for handling big integers.
return (Number(a) || 0) - (Number(b) || 0); return (Number(a) || 0) - (Number(b) || 0);
}).pop().toString(); }).pop() || 0).toString();
mailboxCache[folder.path] = { mailboxCache[folder.path] = {
exists: lastUid, exists: lastUid,