Phantom mail(messageKey=sizeOndisk, messageSize=0, no subject, 1970/01/01) is generated, if move from local folder to local folder, and if move fails because mail is deleted by other one while moving



4 years ago
21 days ago


(Reporter: World, Unassigned, NeedInfo)


(Blocks: 2 bugs)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


User Story

See comment #4 for simple STR.


(1 attachment)



4 years ago
+++ This bug was initially created as a clone of Bug #1110577 +++
This is spin-off of Bug 1106225 Comment 2.

Phantom mail(messageKey=sizeOndisk, messageSize=0, no subject, 1970/01/01) is generated, if move from local folder to local folder, and if move fails because mail is deleted by other one while moving.

[Steps to reproduce : Utilize Bug 1106225]
(1) At local folder, Search, Select multiple mails, "Move To" to local mail folder.
      move target folder = Local Folder/Parent/FolderX
      => CopyMessage is requested "target folder depth" times(Bug 1106225)
(3) When DoCopy for CopyService request #N is executed, 
      mail in move source folder(Searched IMAP mbox) is already deleted by
      DoCopy for CopyService request #1.
      So, error in DoCopy #N occurs.
      => Because error while "local to local move", a phantom mail is created upon first error.
      => Because Offset of phantom mail is always sizeOnDisk.
            messageKey=messageOffset=sizeOnDisk && messageSize=0 is used,
            so msgDBHdr for phantom mail is re-used by all subsequent phantom mails.
            Then one phantom mail only isobserved.


4 years ago
Component: Database → Backend


4 years ago
No longer depends on: 1110577


4 years ago
Blocks: 1106225
No longer depends on: 1106225


4 years ago
No longer blocks: 1106225
See Also: → bug 1106225

Comment 1

4 years ago
[Steps to reproduce #2: Utilize spec of <menupopup type="folder">] has been found. See Bug 1106225 Comment 23.


2 years ago
Blocks: 209501

Comment 2

2 years ago
Are there good theories of what conditions/bugs cause failure of DoCopy that can fix this (and the uplevel bugs)?
Flags: needinfo?(ishikawa)
Flags: needinfo?(acelists)

Comment 3

2 years ago
I can't think of a reason off my head right now.
But I will re-visit this again in a few days, and so put another needinfo to myself.
Flags: needinfo?(ishikawa)


2 years ago
See Also: → bug 1319299

Comment 4

2 years ago
Created attachment 8813758 [details]
Toolbar button script to generate phantom mails

[New simple Steps to reproduce problem]

(1) Create Toolbbar button for test.
(1-1) Install "Custom Buttons" addon, and create a Toolbar button using the addon.
(1-2) Copy attached script to the created Toolbar button.
      (if you want to change number of phantom mails, please change loop count.)
(2) Create local mail folder named "Test", "Test/S1" under "Local Folders".
    (it's hard coded in script. if you use other folder, please modify a var in script.)
  Thread pane column : Order Received, Date, Size
(3) Create Virtual Folder(Search Folder).
  Search Target folders : some local mail folders which are appropriate for your testing.
  Condition : Subject doesn't contain !!!!! (=> all mails hits) 
  Thread pane column : Order Received, Date, Size, Location (Account if required)
(4) At the Virtual Folder(Search Folder)
(4-1) Select some mails at Thread pane,
(4-2) Add tag(eg. Important) to the selected mails for ease of observation(not mandatory).
(4-3) Click Toolbar button created at step (1),
      with keeping the Virtual Folder selected,
      with keeping the mails are selected.
(5) Check Local Folders, Test/S1
  => Many phantom mails are generated.
  => Selected mails at step (4-1) are normally moved.
  => No dup mails is generated if Thunderbird 45 or newer.
(6) At Test/S1, do clean up work for next test.
(6-1) Move a non-phantom mail in Test/S1 to a local mail folder, in order to invoke Compact.
(6-2) Compact => phantom mails disappear. messageKey(Order Received) is unchanged.
(6-3) Folder Properties, Repair Folder => messageKey(Order Received) is re-assigned from 1.
(7) Go to step (4)

If step (4) is done at Real Folder(non Virtual Folder, non Search Folder), phantom mail at move target folder couldn't be observed in my tests.
If move source folder and/or move target folder at step (4) is IMAP folder, phenomenon is different, because mechanism of "move mails" in IMAP is different from "move mails between local mail folders".


2 years ago
User Story: (updated)


2 years ago
Blocks: 1110577
Comment hidden (me-too)
You need to log in before you can comment on or make changes to this bug.