Closed Bug 1854361 Opened 2 years ago Closed 2 years ago

[imap-js] wrongly stores invalid message in cache

Categories

(MailNews Core :: Networking: IMAP, defect)

defect

Tracking

(thunderbird_esr115- wontfix)

RESOLVED FIXED
119 Branch
Tracking Status
thunderbird_esr115 - wontfix

People

(Reporter: john, Assigned: john)

References

Details

Attachments

(2 files)

Attached image sync settings.JPG

While debugging Bug 1851074 I also checked how the js version of our IMAP implementation is handling the situation and found a strange behavior in ImapChannel.jsm:onCacheEntryAvailable (link)

STR

  • setup the sync settings of an IMAP account as shown in the attached image

  • set a breakpoint in onCacheEntryAvailable

  • send yourself a couple of test messages which have an attachment to make sure they are larger than 1KB and hit the no-download-criteria

  • cycle through the messages and observe the new and status parameters of onCacheEntryAvailable

  • status will always be 0 and new will be true the first time we view a message

  • once new is false, the message will be pulled from _readFromCacheStream in the last line of onCacheEntryAvailable

  • restarting Thunderbird will make new true again when opening a message for the first time

  • make sure all messages have been viewed at least once and disconnect your network

  • the messages are still pulled from the cache

  • keep the network disabled and restart TB

  • again cycle through the messages

  • when accessing a message for the first time, parameter newwill be true and the function tries to read the message from the server and fails (there is a connection error) but it looks like it saves an empty msgHdr in the cache

  • any follow up access will not trigger a connection error, because it pulls the empty header from the cache and returns the entire operation as a success

  • enable your network connection again

  • the messages will still not show up, because it continues to pull the empty msgHdr from the cache.

Component: Add-Ons: Extensions API → General
Blocks: 1851074
No longer depends on: 1851074

We should not store empty message headers in case of connection errors and keep reporting the connection errors on all follow-up read requests, until the connection comes back again.

Component: General → Networking: IMAP
Product: Thunderbird → MailNews Core
Summary: mailnews.imap.jsmodule wrongly reports message from cache → [imap-js] wrongly reports message from cache
Assignee: nobody → john
Status: NEW → ASSIGNED
Summary: [imap-js] wrongly reports message from cache → [imap-js] wrongly stores invalid message in cache
Blocks: 1854578
No longer blocks: 1854578

Pushed by martin@humanoids.be:
https://hg.mozilla.org/comm-central/rev/a51fb7ea975c
Remove invalid cache, if message could not be fetched from server. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: