Closed Bug 1719996 Opened 3 months ago Closed 25 days ago

Remove nsISeekableStream assumption from message writing code.

Categories

(MailNews Core :: Backend, task)

Tracking

(thunderbird_esr78 wontfix, thunderbird_esr91 wontfix)

RESOLVED FIXED
91 Branch
Tracking Status
thunderbird_esr78 --- wontfix
thunderbird_esr91 --- wontfix

People

(Reporter: benc, Assigned: benc)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

As a holdover from the mbox-only days, a lot of the code which writes out messages assumes that it is always writing to a seekable stream.
Usually this is used to force the file position to the end of the file for appending.
But there are a few places which use it to determine the message offset in the file.
Both of these should be handled by other means.

No functional changes, just adds a few comments and shuffles around some of
the member declarations to better show which memory buffers the values point
into.

See Also: → 1720047
Status: NEW → ASSIGNED
Target Milestone: --- → 91 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/189a9eedb45f
Some minor clarifications for nsParseMailMessageState. r=mkmelin
https://hg.mozilla.org/comm-central/rev/bddb0660ea90
Remove nsPop3Sink assumption that message output stream is seekable. r=mkmelin

This removes an nsIMsgHdr.setMessageOffset() call. That call was redundant - it's handled
already inside the mbox mailstore.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/8c94e187005d
Remove nsImapMailFolder assumption that message output stream is seekable. r=mkmelin
https://hg.mozilla.org/comm-central/rev/f2e31554f987
Remove nsImapService assumption that message output stream is seekable. r=mkmelin

Was this "fixed"?

(In reply to Worcester12345 from comment #7)

Was this "fixed"?

Not yet. There are still a few places that assume we're always dealing with mbox files.

Depends on: 1728924

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/32e946603b43
Remove some output stream seeks in nsMsgLocalMailFolder. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED

Reopening - looks like the patch in Comment 9 caused an issue (Bug 1729778), so I'm backing it out for now.

My take on it is that the old code was relying on the nsISeekable QI to fail, in order to detect if the copy destination was a non-offline IMAP folder.
I'll have another go at it.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #9239309 - Attachment description: Bug 1719996 - Remove some output stream seeks in nsMsgLocalMailFolder. r?mkmelin → Bug 1719996 - Remove some output stream seeks in nsMsgLocalMailFolder. r=mkmelin

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/4f110d7df0f8
Remove unused txnMgr var in nsMsgCopyService::CopyFileMessage(). r=mkmelin

Status: REOPENED → RESOLVED
Closed: 1 month ago26 days ago
Resolution: --- → FIXED

Oops - https://phabricator.services.mozilla.com/D124428 slipped through the net.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ffc062c99371
Remove some output stream seeks in nsMsgLocalMailFolder. r=mkmelin

Status: REOPENED → RESOLVED
Closed: 26 days ago25 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.