Closed Bug 1022443 Opened 10 years ago Closed 3 years ago

Moving thunderbird window interrupts drag and drop of mail from OS to Thunderbird

Categories

(Thunderbird :: Mail Window Front End, defect)

24 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: sfystone, Unassigned)

References

Details

Debian amd64, Icedove 24.5.0

I'm trying to move mail between 2 computers by save mail into .eml file on computer A and then drag the files into a mail folder in icedove in computer B.
The import sometimes failes without any error message in the Error Console. I manage to reproduce this and...

Prepair:
1. Thunderbird (Icedove) window should be restored and able to move
2. A folder: Local Folders -> Inbox4fengyuan.shi -> 4
3. Some 300 .eml files saved from my another inbox. 
4. Have another program running so that you can click on its title bar to focus on it. Or your desktop is also ok if it's with folders or other icons on it.

Step:
1. Click the folder "4", 
2. Select all the 300 .eml files with your file manager(nautilus for me). And drag & drop them into folder "4" (drop on "4" in folder list or the mail list in the "4")
3. Now the .eml file should be importing one by one. note the "Total: " number of the folder.
4. Before the importing is finished, click on the title bar of your Thunderbird/Icedove to focus, then click on another program to focus.
5. Grab the title bar of your thunderbird. Move your mouse to Move the window of thunderbird.

Expected result:
The .eml import continues

Actual result:
The .eml import stop without any warning. The "Total: " of the folder no more grows.


Shake the window to stop import... Guess should not be for on PC.
And operations on nautilus file manager also make reproduce of this bug. Now I guess it's because of the way thunderbird retrieve the files from nautilus.
And there are more method to reproduce it. 
Well, anyway, the workaround is do nothing and just wait while it's importing.
Drop event is invoked on "a tree cell of Folder Tree View at Folder Pane" and processed under the "tree cell element", and "original event object which is passed from OS to Thunderbird" is associated to Thunderbird Window in the OS.

When multiple eml files are dropped on a folder at Folder Pane, following is executed.
> http://mxr.mozilla.org/comm-central/source/mail/base/content/folderPane.js#787
> 708   drop: function ftv_drop(aRow, aOrientation) {
> Because event.dataTransfer.types[0] == "application/x-moz-file" is set in event object,
> 787     else if (Array.indexOf(types, "application/x-moz-file") != -1) { ... is executed.
> And because file extention == ".eml", following is executed for each .eml file set in event.dataTransfer.files[nn].
>     cs.CopyFileMessage(extFile, targetFolder, null, false, 1, "", null, msgWindow);
> On Win, event.dataTransfer.files[nn].mozFullPath is string of C:\wada\@@@\@work\EML\bug-729742-Newsletter-5.eml
See bug 866951 and bug 948082 for Drag&Drop.

So, it may be one of following.
(a) Drop event is processed by drop event handler of a tree cell of Folder Pane.
     If Thunderbird Window is moved, Folder Pane is re-constructed, so "tree cell where drop event was processed" disappers.
(b) If Thunderbird Window is moved before "dragend event is invoked at element where drag is started, after end of drop event handler process", "original drag&drop event object which is passed from OS to Thunderbird" is removed or disappers.

If this kind of problem, following may be needed.
1. When drop event handler is invoked at a folder tree, get resource name of all relevant resources to Drag&Drop.
2. Save the resource names and required action in msgFolder object.
3. Generate a batch type job under msgFolder, and invoke the batch type job under the msgFolder.
    Needless to say, Compact, Rebuild Index, Delete/Remame/Move folder etc. shouldn't be scheduled
    while the batch type job is running.
4. Wait for end of the batch type job.
5. After end of batch type job, return to caller => dragend is invoked at element where drag is started.
Tried to reproduce on windows8, but the import is just too fast. Guess it's a matter of UEFI. I'm get a result.
FYI. If IMAP folder(Offline-Use=Off) and if big .eml with big attachments, it takes sufficiently wrong to import many mails from .eml files.
Paul, Thommie, does this happen for you on solaris and suse respectively?
Flags: needinfo?(t.rother)
Flags: needinfo?(pkeusem)
Wayne,

I have never tried the process described above for moving mail between machines.  I have always been able to open both mailboxes from within a single instance of Thunderbird and just dragged them from one mailbox to the other.  I can't remember every having any problems with that on Solaris or Linux.
Flags: needinfo?(pkeusem)
Hi all,
I also never used this process for export/migration of mail data. By the way, export of mails into *.eml works fine on current TB 45.2 on OpenSUSE Leap.

I would recommend to migrate the complete TB profile instead of individual mails.
Flags: needinfo?(t.rother)
(In reply to Thommie Rother from comment #8)
> Hi all,
> I also never used this process for export/migration of mail data. By the
> way, export of mails into *.eml works fine on current TB 45.2 on OpenSUSE
> Leap.

The important question for this bug isn't really about how to best import or move mail, but whether the drag and drop fails.

I could not reproduce this on windows. But perhaps my system is too fast.
Perhaps there is a match in one of these bug reports https://mzl.la/29v1wVW 
> I would recommend to migrate the complete TB profile instead of individual
> mails.
Component: General → Mail Window Front End
Summary: Moving thunderbird window fakes Mail Import → Moving thunderbird window interrupts drag and drop of mail from OS to Thunderbird
See Also: → 458570

(In reply to fengyuan from comment #1)

And operations on nautilus file manager also make reproduce of this bug. Now
I guess it's because of the way thunderbird retrieve the files from nautilus.

fengyuan, can you still reproduce this?

Flags: needinfo?(sfystone)

No reply from reporter -> Incomplete

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Flags: needinfo?(sfystone)
You need to log in before you can comment on or make changes to this bug.