From e1c35a75c64ac26b0f59de2b2c306c2359658162 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Tue, 26 Nov 2024 12:23:24 +0200 Subject: [PATCH] Bug 1933116 - Fix "Overwriting an existing document channel!" assertion in tests. r=tobyp Differential Revision: https://phabricator.services.mozilla.com/D230069 --HG-- extra : amend_source : bb001931a73bac04463caa171c852de0620770d2 --- mailnews/base/src/nsMsgProtocol.cpp | 1 + mailnews/imap/src/nsImapProtocol.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/mailnews/base/src/nsMsgProtocol.cpp b/mailnews/base/src/nsMsgProtocol.cpp index 1f13b3c29c..1b67c30519 100644 --- a/mailnews/base/src/nsMsgProtocol.cpp +++ b/mailnews/base/src/nsMsgProtocol.cpp @@ -428,6 +428,7 @@ NS_IMETHODIMP nsMsgProtocol::Open(nsIInputStream** _retval) { } NS_IMETHODIMP nsMsgProtocol::AsyncOpen(nsIStreamListener* aListener) { + mLoadFlags |= nsIChannel::LOAD_REPLACE; nsCOMPtr listener = aListener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index cc0cd01e41..48ce2166b5 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -9559,6 +9559,7 @@ bool nsImapMockChannel::ReadFromLocalCache() { NS_IMETHODIMP nsImapMockChannel::AsyncOpen(nsIStreamListener* aListener) { MOZ_ASSERT(NS_IsMainThread(), "nsIChannel methods must be called from main thread"); + mLoadFlags |= nsIChannel::LOAD_REPLACE; nsCOMPtr listener = aListener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);