Bug 1592256 - Follow-up: remove data from cache when it is no longer relevant. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 05 Nov 2019 11:22:01 +1300
changeset 36556 39b07c84497e3ef43bf7e672d9fb97bd6a9644f1
parent 36555 7cd9756e2aa1aa0322967ea1d6b309631ca73c5f
child 36557 801bb3e237b67f3310a096336202b33fb26d9fce
push id2534
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:52:51 +0000
treeherdercomm-beta@055c50840778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1592256
Bug 1592256 - Follow-up: remove data from cache when it is no longer relevant. r=mkmelin
mail/components/extensions/parent/ext-mail.js
--- a/mail/components/extensions/parent/ext-mail.js
+++ b/mail/components/extensions/parent/ext-mail.js
@@ -1405,17 +1405,19 @@ var messageTracker = {
     let folder = MailServices.folderLookup.getFolderForURL(value.folderURI);
     if (folder) {
       let msgHdr = folder.msgDatabase.getMsgHdrForMessageID(value.messageId);
       if (msgHdr) {
         return msgHdr;
       }
     }
 
+    let hash = JSON.stringify([value.folderURI, value.messageId]);
     this._messages.delete(id);
+    this._messageIds.delete(hash);
     return null;
   },
 };
 
 /**
  * Tracks lists of messages so that an extension can consume them in chunks.
  * Any WebExtensions method that could return multiple messages should instead call
  * messageListTracker.startList and return the results, which contain the first