Bug 713768 - Permanent orange | TEST-UNEXPECTED-FAIL | test_nsIMsgFolderListenerLocal.js | exception thrown from do_timeout callback nsIMsgFolder.deleteMessages (32 bit Linux & Mac). r=Standard8
authorDavid Bienvenu <dbienvenu@mozilla.com>
Mon, 09 Jan 2012 08:44:46 +0000
changeset 10375 26a499076c7ed60f4d115c3c7fa0caf38fd02636
parent 10374 b425904a629f856318dda9f78ec09951c76f9bd8
child 10376 70fa39beb291c7e8db1ffb1d8d829bc525f9304c
push id402
push userbugzilla@standard8.plus.com
push dateTue, 13 Mar 2012 21:17:18 +0000
treeherdercomm-beta@d080a8ebf16a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs713768
Bug 713768 - Permanent orange | TEST-UNEXPECTED-FAIL | test_nsIMsgFolderListenerLocal.js | exception thrown from do_timeout callback nsIMsgFolder.deleteMessages (32 bit Linux & Mac). r=Standard8
mailnews/local/src/nsMsgBrkMBoxStore.cpp
--- a/mailnews/local/src/nsMsgBrkMBoxStore.cpp
+++ b/mailnews/local/src/nsMsgBrkMBoxStore.cpp
@@ -549,37 +549,37 @@ NS_IMETHODIMP nsMsgBrkMBoxStore::CopyFol
     summaryFile->Exists(&exists);
     summaryFile->GetFileSize(&fileSize);
     if (exists && fileSize > 0)
       NS_ENSURE_SUCCESS(rv, rv); // Yes, it should have worked !
     // else case is filespec is zero sized, no need to copy it,
     // not an error
   }
 
+  nsCOMPtr<nsIMsgFolder> newMsgFolder;
+  rv = aDstFolder->AddSubfolder(safeFolderName, getter_AddRefs(newMsgFolder));
+  NS_ENSURE_SUCCESS(rv, rv);
+
   // linux and mac are not good about maintaining the file stamp when copying
   // folders around. So if the source folder db is good, set the dest db as
   // good too.
   nsCOMPtr<nsIMsgDatabase> destDB;
   if (summaryValid)
   {
     nsAutoString folderLeafName;
     origPath->GetLeafName(folderLeafName);
     newPath->Append(folderLeafName);
     nsCOMPtr<nsIMsgDBService> msgDBService =
       do_GetService(NS_MSGDB_SERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
-    rv = msgDBService->OpenMailDBFromFile(newPath, aSrcFolder, false,
+    rv = msgDBService->OpenMailDBFromFile(newPath, newMsgFolder, false,
                                           true, getter_AddRefs(destDB));
     if (rv == NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE && destDB)
       destDB->SetSummaryValid(true);
   }
-  nsCOMPtr<nsIMsgFolder> newMsgFolder;
-  rv = aDstFolder->AddSubfolder(safeFolderName, getter_AddRefs(newMsgFolder));
-  NS_ENSURE_SUCCESS(rv, rv);
-
   newMsgFolder->SetPrettyName(folderName);
   PRUint32 flags;
   aSrcFolder->GetFlags(&flags);
   newMsgFolder->SetFlags(flags);
   bool changed = false;
   rv = aSrcFolder->MatchOrChangeFilterDestination(newMsgFolder, true, &changed);
   if (changed)
     aSrcFolder->AlertFilterChanged(aMsgWindow);