From 95a1aeb0e8a317b144f87d4aee76736a80938daa Mon Sep 17 00:00:00 2001 From: Magnus Melin Date: Thu, 15 Sep 2022 20:38:55 +1000 Subject: [PATCH] Backed out changeset 6533be800ca3 (bug 1762688) for test failures on debug. rs=backout --- mailnews/imap/src/ImapClient.jsm | 34 ++----------------- mailnews/imap/src/ImapIncomingServer.jsm | 6 +--- mailnews/imap/src/ImapResponse.jsm | 2 +- mailnews/imap/src/ImapService.jsm | 11 ------ .../imap/test/unit/test_listSubscribed.js | 4 --- mailnews/imap/test/unit/xpcshell-cpp.ini | 3 ++ mailnews/imap/test/unit/xpcshell-shared.ini | 3 -- .../imap/test/unit/xpcshell_maildir-cpp.ini | 3 ++ 8 files changed, 10 insertions(+), 56 deletions(-) diff --git a/mailnews/imap/src/ImapClient.jsm b/mailnews/imap/src/ImapClient.jsm index 9125aed8cb..890d35c1bc 100644 --- a/mailnews/imap/src/ImapClient.jsm +++ b/mailnews/imap/src/ImapClient.jsm @@ -140,7 +140,6 @@ class ImapClient { */ discoverAllFolders(folder) { this._logger.debug("discoverAllFolders", folder.URI); - let supportsListExtended = this._capabilities.includes("LIST-EXTENDED"); let handleListResponse = res => { this._hasTrash = res.mailboxes.some( mailbox => mailbox.flags & ImapUtils.FLAG_IMAP_TRASH @@ -165,31 +164,13 @@ class ImapClient { }; this._nextAction = res => { - if (supportsListExtended) { + this._nextAction = res => { handleListResponse(res); this._actionFinishFolderDiscovery(); - return; - } - this._nextAction = res2 => { - // Per rfc3501#section-6.3.9, if LSUB returns different flags from LIST, - // use the LIST responses. - for (let mailbox of res2.mailboxes) { - let mailboxFromList = res.mailboxes.find(x => x.name == mailbox.name); - if ( - mailboxFromList?.flags && - mailboxFromList?.flags != mailbox.flags - ) { - mailbox.flags = mailboxFromList.flags; - } - } - handleListResponse(res2); - this._actionFinishFolderDiscovery(); }; this._sendTagged('LSUB "" "*"'); }; - this._sendTagged( - supportsListExtended ? 'LIST (SUBSCRIBED) "" "*"' : 'LIST "" "*"' - ); + this._sendTagged('LIST "" "*"'); } /** @@ -241,17 +222,6 @@ class ImapClient { this._sendTagged(`RENAME "${oldName}" "${newName}"`); } - /** - * Send LIST command for a folder. - * @param {nsIMsgFolder} folder - The folder to list. - */ - listFolder(folder) { - this._logger.debug("listFolder", folder.URI); - this._actionList(this._getServerFolderName(folder), () => { - this._actionDone(); - }); - } - /** * Ensure a folder exists on the server. Create one if not already exists. * @param {nsIMsgFolder} parent - The parent folder to check. diff --git a/mailnews/imap/src/ImapIncomingServer.jsm b/mailnews/imap/src/ImapIncomingServer.jsm index 90e7216ad5..6a746ffaf5 100644 --- a/mailnews/imap/src/ImapIncomingServer.jsm +++ b/mailnews/imap/src/ImapIncomingServer.jsm @@ -242,11 +242,7 @@ class ImapIncomingServer extends MsgIncomingServer { imapFolder.explicitlyVerify || (folder.hasSubFolders && this._noDescendentsAreVerified(folder)) ) { - let isNamespace = false; - try { - isNamespace = imapFolder.isNamespace; - } catch (e) {} - if (!isNamespace) { + if (!imapFolder.isNamespace) { // If there are no subfolders and this is unverified, we don't want to // run this url. That is, we want to undiscover the folder. // If there are subfolders and no descendants are verified, we want to diff --git a/mailnews/imap/src/ImapResponse.jsm b/mailnews/imap/src/ImapResponse.jsm index 9cc31a950e..a44366e57c 100644 --- a/mailnews/imap/src/ImapResponse.jsm +++ b/mailnews/imap/src/ImapResponse.jsm @@ -384,7 +384,7 @@ class MailboxData { "\\NOINFERIORS": // RFC 5258 \NoInferiors implies \HasNoChildren ImapUtils.FLAG_NO_INFERIORS | ImapUtils.FLAG_HAS_NO_CHILDREN, - "\\NOSELECT": ImapUtils.FLAG_NO_SELECT, + "\\NOSELECT": ImapUtils.NO_SELECT, "\\TRASH": ImapUtils.FLAG_IMAP_TRASH | ImapUtils.FLAG_IMAP_XLIST_TRASH, "\\SENT": ImapUtils.FLAG_IMAP_SENT, "\\SPAM": ImapUtils.FLAG_IMAP_SPAM, diff --git a/mailnews/imap/src/ImapService.jsm b/mailnews/imap/src/ImapService.jsm index 80b2bbc621..663c15ffcb 100644 --- a/mailnews/imap/src/ImapService.jsm +++ b/mailnews/imap/src/ImapService.jsm @@ -256,17 +256,6 @@ class ImapService { }); } - listFolder(folder, urlListener) { - this._withClient(folder, client => { - let runningUrl = client.startRunningUrl(urlListener); - runningUrl.QueryInterface(Ci.nsIImapUrl).imapAction = - Ci.nsIImapUrl.nsImapListFolder; - client.onReady = () => { - client.listFolder(folder); - }; - }); - } - storeCustomKeywords(folder, msgWindow, flagsToAdd, flagsToSubtract, uids) { return this._withClient(folder, (client, runningUrl) => { client.startRunningUrl(null, msgWindow, runningUrl); diff --git a/mailnews/imap/test/unit/test_listSubscribed.js b/mailnews/imap/test/unit/test_listSubscribed.js index c1d9e60dce..a7382ca9ea 100644 --- a/mailnews/imap/test/unit/test_listSubscribed.js +++ b/mailnews/imap/test/unit/test_listSubscribed.js @@ -76,10 +76,6 @@ add_task(async function testListSubscribed() { }); add_task(async function testZimbraServerVersions() { - if (Services.prefs.getBoolPref("mailnews.imap.jsmodule", false)) { - return; - } - // older versions of Zimbra can crash if we send LIST (SUBSCRIBED) so we want // to make sure that we are checking for versions diff --git a/mailnews/imap/test/unit/xpcshell-cpp.ini b/mailnews/imap/test/unit/xpcshell-cpp.ini index 9e95e8b19f..6f0897c843 100644 --- a/mailnews/imap/test/unit/xpcshell-cpp.ini +++ b/mailnews/imap/test/unit/xpcshell-cpp.ini @@ -13,8 +13,11 @@ prefs = [test_imapHdrChunking.js] [test_imapHighWater.js] [test_imapUndo.js] +[test_listClosesDB.js] +[test_listSubscribed.js] [test_localToImapFilter.js] [test_localToImapFilterQuarantine.js] +[test_lsub.js] [test_nsIMsgFolderListenerIMAP.js] [test_offlineCopy.js] [test_offlineDraftDataloss.js] diff --git a/mailnews/imap/test/unit/xpcshell-shared.ini b/mailnews/imap/test/unit/xpcshell-shared.ini index eca4163f25..f44add4121 100644 --- a/mailnews/imap/test/unit/xpcshell-shared.ini +++ b/mailnews/imap/test/unit/xpcshell-shared.ini @@ -34,8 +34,5 @@ [test_imapUrls.js] [test_largeOfflineStore.js] skip-if = os == 'mac' -[test_listClosesDB.js] -[test_listSubscribed.js] -[test_lsub.js] [test_mailboxes.js] [test_starttlsFailure.js] diff --git a/mailnews/imap/test/unit/xpcshell_maildir-cpp.ini b/mailnews/imap/test/unit/xpcshell_maildir-cpp.ini index e0852d108e..a869728061 100644 --- a/mailnews/imap/test/unit/xpcshell_maildir-cpp.ini +++ b/mailnews/imap/test/unit/xpcshell_maildir-cpp.ini @@ -13,8 +13,11 @@ prefs = [test_imapHdrChunking.js] [test_imapHighWater.js] [test_imapUndo.js] +[test_listClosesDB.js] +[test_listSubscribed.js] [test_localToImapFilter.js] [test_localToImapFilterQuarantine.js] +[test_lsub.js] [test_nsIMsgFolderListenerIMAP.js] [test_offlineCopy.js] [test_offlineDraftDataloss.js]