Uninitialized moveCopyOpType in nsImapMailFolder::CopyMessagesOffline() when all messages are moved back to their original folder
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(Not tracked)
People
(Reporter: michal.dtz, Assigned: welpy-cw)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
In nsImapMailFolder::CopyMessagesOffline(), nsOfflineImapOperationType moveCopyOpType; is only set inside the if (!messageReturningHome) branch
of the message loop (sourceOp->GetOperation(&moveCopyOpType)). When every
message is "returning home" (moved back while offline to the folder it was
moved out of while offline), it is never set, and the uninitialized value is
passed to the nsImapOfflineTxn constructor as the operation type of the undo
transaction. Undo/redo of that transaction then switches on garbage.
Suggested fix: initialize it (e.g. to isMove ? kMsgMoved : kMsgCopy), or
don't record the transaction when srcMsgs is empty.
Steps: go offline, move a message from folder A to B, move it from B back to
A, then undo.
| Assignee | ||
Comment 2•19 days ago
|
||
Create offline undo transactions only when their header lists are nonempty, avoiding an uninitialized moveCopyOpType read and empty undo entries when all operations are cancelled.
Add regression coverage for cancelled, ordinary, and mixed offline moves with both mbox and maildir stores.
| Assignee | ||
Comment 3•19 days ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #1)
This is very old behavior?
Apparently it's from a regression in Thunderbird 14.0.
Updated•13 days ago
|
| Assignee | ||
Updated•10 days ago
|
Pushed by jtracey@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/3095bf046ee1
Skip empty offline IMAP undo transactions. r=mkmelin
Description
•