Open Bug 1714539 Opened 5 years ago Updated 5 months ago

nsMsgLocalMailFolder::CopyFolder and nsIMsgPluggableStore.copyFolder() are broken

Categories

(MailNews Core :: Backend, defect)

defect

Tracking

(Not tracked)

People

(Reporter: benc, Unassigned)

References

(Blocks 1 open bug)

Details

nsIMsgPluggableStore.copyFolder() has a few issues, particularly when being used for copying rather than moving. Both mbox and maildir:

  1. only invoke localfolder->OnCopyCompleted() for move, not copy. So nsIMsgCopyService never gets told to send out appropriate nsIFolderListener.folderMoveCopyCompleted() notifications.
  2. can fail if required .sbd subdirs don't already exist.

But this is masked somewhat (at least for mbox stores), because nsMsgLocalMailFolder::CopyFolder() has an incorrect check for copies within the same mailstore.

Steps to replicate:
Set the default mailstore type to maildir, then:

./mach xpcshell-test  comm/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js

The first copyfolder test fails to produce the expected notifications.

Assignee: benc → nobody
You need to log in before you can comment on or make changes to this bug.