First patch for bug 646226 (sent messages not indexed anymore with IMAP) r=asuth
authorJonathan Protzenko <jonathan.protzenko@gmail.com>
Tue, 03 May 2011 10:25:39 +0200
changeset 7675 20a1948de3a9211380e80f621c51af9d5470e33b
parent 7674 8ecd228f3bd80d5f7ed0235187f4b61c269cc2a6
child 7676 bdd02cca51f547456eaafb000bfbd70859936f81
push id5890
push userjonathan.protzenko@gmail.com
push dateTue, 03 May 2011 08:26:45 +0000
treeherdercomm-central@20a1948de3a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs646226
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.
mailnews/db/gloda/modules/index_msg.js
--- 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,