Backed out 3 changesets (bug 1521706) for test failures. a=backout
authorJorg K <jorgk@jorgk.com>
Thu, 24 Jan 2019 09:04:14 +0100
changeset 34285 a497d72c3d8aefee03941b0af2b18b673721ccbc
parent 34284 6c2c856e396fb4d4159737bf16545ecb260f7e09
child 34286 d156755548d3f8eb48d9ae12ae51fb728acb0a76
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersbackout
bugs1521706
backs out8283e69c9dfa24a55cd7c1276363043bf69cfcf1
e8392f4d3862a884b04a00c73dc3d2aa5767e720
424dfd930d600a6f76b84fec5587c10f0b273a95
Backed out 3 changesets (bug 1521706) for test failures. a=backout Backed out changeset 8283e69c9dfa (bug 1521706) Backed out changeset e8392f4d3862 (bug 1521706) Backed out changeset 424dfd930d60 (bug 1521706)
mailnews/base/public/nsIFolderListener.idl
mailnews/base/public/nsIMsgFolder.idl
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/news/src/nsNewsFolder.cpp
mailnews/test/resources/messageInjection.js
--- a/mailnews/base/public/nsIFolderListener.idl
+++ b/mailnews/base/public/nsIFolderListener.idl
@@ -51,9 +51,12 @@ interface nsIFolderListener : nsISupport
                                  in ACString aProperty,
                                  in unsigned long aOldFlag,
                                  in unsigned long aNewFlag);
 
   const folderListenerNotifyFlagValue event = 0x80;
   void OnItemEvent(in nsIMsgFolder aItem, in ACString aEvent);
 
   const folderListenerNotifyFlagValue all = 0xFFFFFFFF;
+
+  //  void OnFolderLoaded(in nsIMsgFolder aFolder);
+  //  void OnDeleteOrMoveMessagesCompleted(in nsIMsgFolder aFolder);
 };
--- a/mailnews/base/public/nsIMsgFolder.idl
+++ b/mailnews/base/public/nsIMsgFolder.idl
@@ -690,16 +690,19 @@ interface nsIMsgFolder : nsISupports {
                                     in AString oldValue,
                                     in AString newValue);
 
   void NotifyItemAdded(in nsISupports item);
   void NotifyItemRemoved(in nsISupports item);
 
   void NotifyFolderEvent(in ACString event);
 
+  //  void NotifyFolderLoaded();
+  //  void NotifyDeleteOrMoveMessagesCompleted(in nsIMsgFolder folder);
+
   // Gets all descendants, not just first level children.
   readonly attribute nsIArray descendants;
   /*
    * Lists all the folders that are subfolders of the current folder,
    * all levels of children.
    *
    * @param aDescendants  The array in which to append the found folder(s).
    */
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -2248,21 +2248,16 @@ NS_IMETHODIMP nsImapMailFolder::DeleteMe
             nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
             if (notifier)
               notifier->NotifyMsgsDeleted(messages);
           }
           DeleteStoreMessages(messages);
           database->DeleteMessages(srcKeyArray.Length(), srcKeyArray.Elements(), nullptr);
           EnableNotifications(allMessageCountNotifications, true);
         }
-        if (listener)
-        {
-          listener->OnStartCopy();
-          listener->OnStopCopy(NS_OK);
-        }
         NotifyFolderEvent(kDeleteOrMoveMsgCompleted);
       }
     }
     return rv;
   }
 
   // have to move the messages to the trash
   if(trashFolder)
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -1133,24 +1133,18 @@ nsMsgLocalMailFolder::DeleteMessages(nsI
   }
 
   bool isTrashFolder = mFlags & nsMsgFolderFlags::Trash;
 
   // notify on delete from trash and shift-delete
   if (!isMove && (deleteStorage || isTrashFolder))
   {
     nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
-    if (notifier) {
-      if (listener)
-      {
-        listener->OnStartCopy();
-        listener->OnStopCopy(NS_OK);
-      }
-      notifier->NotifyMsgsDeleted(messages);
-    }
+    if (notifier)
+        notifier->NotifyMsgsDeleted(messages);
   }
 
   if (!deleteStorage && !isTrashFolder)
   {
     nsCOMPtr<nsIMsgFolder> trashFolder;
     rv = GetTrashFolder(getter_AddRefs(trashFolder));
     if (NS_SUCCEEDED(rv))
     {
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -791,22 +791,16 @@ nsMsgNewsFolder::DeleteMessages(nsIArray
     }
     EnableNotifications(allMessageCountNotifications, true);
   }
 
   if (!isMove)
     NotifyFolderEvent(NS_SUCCEEDED(rv) ? kDeleteOrMoveMsgCompleted :
       kDeleteOrMoveMsgFailed);
 
-  if (listener)
-  {
-    listener->OnStartCopy();
-    listener->OnStopCopy(NS_OK);
-  }
-
   (void) RefreshSizeOnDisk();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::CancelMessage(nsIMsgDBHdr *msgHdr,
                                              nsIMsgWindow *aMsgWindow)
 {
--- a/mailnews/test/resources/messageInjection.js
+++ b/mailnews/test/resources/messageInjection.js
@@ -979,37 +979,36 @@ function async_trash_messages(aSynMessag
     },
   });
 }
 
 /**
  * Delete all of the messages in a SyntheticMessageSet like the user performed a
  *  shift-delete (or if the messages were already in the trash).
  *
+ * This is actually a synchronous operation.  I'm surprised too.
+ *
  * @param aSynMessageSet The set of messages to delete.  The messages do not all
  *     have to be in the same folder, but we have to delete them folder by
  *     folder if they are not.
  */
 function async_delete_messages(aSynMessageSet) {
-  return async_run({func: function*() {
-    mark_action("messageInjection", "deleting messages",
-                aSynMessageSet.msgHdrList);
-    for (let [folder, xpcomHdrArray] of
-         aSynMessageSet.foldersWithXpcomHdrArrays()) {
-      mark_action("messageInjection", "deleting messages in folder",
-                  [folder]);
-      folder.deleteMessages(xpcomHdrArray, null,
-                            /* delete storage */ true,
-                            /* is move? */ false,
-                            asyncCopyListener,
-                            /* do not allow undo, currently leaks */ false);
-      yield false;
-    }
-    yield true;
-  }});
+  mark_action("messageInjection", "deleting messages",
+              aSynMessageSet.msgHdrList);
+  for (let [folder, xpcomHdrArray] of
+       aSynMessageSet.foldersWithXpcomHdrArrays()) {
+    mark_action("messageInjection", "deleting messages in folder",
+                [folder]);
+    folder.deleteMessages(xpcomHdrArray, null,
+                          /* delete storage */ true,
+                          /* is move? */ false,
+                          asyncCopyListener,
+                          /* do not allow undo, currently leaks */ false);
+  }
+  return true;
 }
 
 /**
  * Empty the trash.
  */
 function async_empty_trash() {
   return async_run({func: function*() {
     let trashHandle = get_trash_folder();