Message pane reloads endlessly for an IMAP message containing <img src="#"> (regression in 158.0)
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(thunderbird_esr153 unaffected, thunderbird160 wontfix, thunderbird161? fixed, thunderbird162 affected)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr153 | --- | unaffected |
| thunderbird160 | --- | wontfix |
| thunderbird161 | ? | fixed |
| thunderbird162 | --- | affected |
People
(Reporter: mike, Assigned: welpy-cw)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
Steps to reproduce
- New profile, IMAP account with default settings ("Keep messages for this account on this computer" on).
- Put the message below into INBOX.
- Select it so it shows in the message pane. Remote content stays blocked.
From: probe@example.com
To: measure@example.test
Subject: R img-hash
Date: Thu, 05 Nov 2026 08:00:00 +0000
Message-ID: <r-img-hash@probe.example.com>
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
<html><body>
<p>See my results</p>
<img src="#" width="1" height="1">
</body></html>
Actual results
The message pane flashes and keeps showing "Loading Message…". It reloads several times a second and never settles.
Expected results
The message renders once, as it does in 157.0.1
| Assignee | ||
Comment 1•15 days ago
|
||
Confirmed locally with a fresh complete build.
The first failing callback belongs to the image subrequest (TYPE_IMAGE):
ImapOfflineMsgStreamListener::OnDataAvailable() forwards a consumer failure
of NS_BINDING_ABORTED, and the input stream pump passes that same failure to
OnStopRequest(). The offline message bytes are intact. This is not initially
a storage read failure.
The recovery logic added in bug 1929105 treats any failed delivery as evidence
of a damaged offline copy. It calls DiscardOfflineMsg(), which clears the
Offline flag. FolderDBListener.onHdrFlagsChanged() then reloads the displayed
message, leading to repeated invalidation, downloads, mailbox growth, and UI
work.
The mozregression range also spans different Gecko revisions. Taskcluster's
Linux opt build definitions identify the Gecko window as:
- Good:
3b08ff1879d5684fb00430411a9c38ea27e1cdc2 - Bad:
24b31c98c7b9663cc0c098ee2bb81a7047f7479f
Sources: good build task,
bad build task.
This Gecko range includes bug 2062317, changeset
804c6b6730e65a1fff654de5eb38aea90bf0db6d (more synchronous DOMContentLoaded).
On current unmodified production code:
- With
dom.document.domcontentloaded.synchronous.enabled=true, the message
repeatedly loses its offline copy and reloads without completing a load. - With that preference set to false, there is one wrongful invalidation and
reload, after which the message settles. - Restoring the old numeric-ID
HasMsgOffline()check from before the
September bug 2065695 patch does not change either result in the current
tree.
These results strongly implicate bug 2062317 as the timing change exposing the
older Thunderbird defect. They do not constitute a complete historical-build
or single-changeset backout comparison, so the precise regression attribution
remains provisional.
The local fix tracks errors returned by the offline input stream independently
of consumer failures and cancellations. Offline copies are discarded only
after a storage read failure, preserving recovery for genuinely damaged
messages.
Validation passed:
- Complete build, with no compiler warnings.
- Browser regression test: the hash-image message loads once, retains its
Offline flag and storeToken, and causes no mailbox growth. The new test
fails on the unfixed build. - Existing browser coverage for four damaged storeToken cases.
- Offline-store unit tests with both mbox and maildir, covering consumer
failures in OnStartRequest and OnDataAvailable, plus a genuine mbox read
failure. - commlint on all changed files.
| Assignee | ||
Comment 2•15 days ago
|
||
Record offline-store read failures separately from consumer errors so a
failed image request cannot discard a valid copy and trigger a reload loop.
Add regression coverage for self-referencing images, consumer callback
failures, and genuine read failures, preserving damaged-message recovery.
Updated•14 days ago
|
Updated•14 days ago
|
| Assignee | ||
Updated•14 days ago
|
| Assignee | ||
Updated•10 days ago
|
| Assignee | ||
Updated•10 days ago
|
Pushed by jtracey@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/fe6363985650
Preserve valid IMAP offline copies when message consumers fail. r=mkmelin
| Assignee | ||
Updated•9 days ago
|
Comment 7•7 days ago
|
||
Please request uplift
| Assignee | ||
Comment 8•6 days ago
|
||
Comment on attachment 9675006 [details]
Bug 2089523 - Preserve valid IMAP offline copies when message consumers fail. r=#thunderbird-back-end-reviewers
Uplift Approval Request
- Please state case for uplift consideration and ensure bug severity is set: Recent regression affecting many users.
- User impact if declined: Endless reloading loop when certain (not uncommon) messages are displayed.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Daily?: Yes
- Has the fix been verified in Beta?: N/A
- Needs manual test from QA?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Relatively confined and straightforward fix.
- Does the fix cause any migrations to be skipped?: No
- String changes made/needed: None.
Comment 9•3 days ago
|
||
Comment on attachment 9675006 [details]
Bug 2089523 - Preserve valid IMAP offline copies when message consumers fail. r=#thunderbird-back-end-reviewers
[Triage Comment]
Approved for beta
Comment 10•2 days ago
|
||
| bugherder uplift | ||
Thunderbird 161.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/06fe2e45b245
Description
•