First patch for
bug 646226 (sent messages not indexed anymore with IMAP) r=asuth
David Bienvenu's recent patches introduced fake sent headers for IMAP, i.e.
headers that are added because we sent the message, and that are bound to be
replaced with the real IMAP header as soon as we figure that one out from the
remote IMAP server. Gloda needed a few tweaks to properly recognize and index
these fake headers.
--- a/mailnews/db/gloda/modules/index_msg.js
+++ b/mailnews/db/gloda/modules/index_msg.js
@@ -2403,16 +2403,20 @@ var GlodaMsgIndexer = {
* should already have been classified) and so can fast-path them.
*/
msgKeyChanged: function gloda_indexer_msgKeyChangeded(aOldMsgKey,
aNewMsgHdr) {
try {
let val = null, newKey = aNewMsgHdr.messageKey;
let [glodaId, glodaDirty] =
PendingCommitTracker.getGlodaState(aNewMsgHdr);
+ // If we haven't indexed this message yet, take no action, and leave it
+ // up to msgsClassified to take proper action.
+ if (glodaId < GLODA_FIRST_VALID_MESSAGE_ID)
+ return;
// take no action on filthy messages,
// generate an entry if dirty or the keys don't match.
if ((glodaDirty !== GlodaMsgIndexer.kMessageFilthy) &&
((glodaDirty === GlodaMsgIndexer.kMessageDirty) ||
(aOldMsgKey !== newKey))) {
val = {
id: glodaId,
key: (aOldMsgKey !== newKey) ? newKey : null,