Drag&drop of multiple attachments creates duplicates
Categories
(Thunderbird :: Message Reader UI, defect)
Tracking
(thunderbird_esr60+, thunderbird_esr68+, thunderbird_esr78 fixed, thunderbird79 fixed)
People
(Reporter: starless, Assigned: khushil324)
References
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
740 bytes,
patch
|
mkmelin
:
review+
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Reporter | ||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment 16•7 years ago
|
||
![]() |
||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
Comment 21•7 years ago
|
||
Working with MAC High Sierra. This error started with Thunderbird 60.xxx. Before copying multiple attachments to a folder did not cause duplicates.
Comment 22•6 years ago
|
||
Alex, you have a Mac, can you please check this.
Comment 23•6 years ago
|
||
I can confirm the issue.
I tested this on both v60.7.2 and trunk on macos Mojave.
Dragging and dropping 3 attachments at once, with 3 difference sizes and file types, resulted in a total of 9 attachments downloaded on the desktop. So it seems the number of times a single file is downloaded is equal to the number of attachments selected.
I see if I have some capacity this week since I'm fixing a couple of regressions in the acctachment list area.
Comment 24•6 years ago
|
||
I can also confirm this on MacOS 10.14.6 (Mojave) and Thunderbird 68.4.1 and 68.4.2. If you drag multiple attachment files to a Finder window it will always create n^2 files instead of n.
Can someone please fix this, this is really annoying.
Comment 25•6 years ago
|
||
Magnus?
Comment 26•6 years ago
|
||
Khushil is working on dnd currently for bug 1226362. Please have a look at this at the same time.
Updated•6 years ago
|
Assignee | ||
Comment 27•5 years ago
|
||
This is kind of a hack. This issue is coming from Mozilla Central.
This line should get called n times instead of n^2 times where n is the total number of attachments: https://searchfox.org/mozilla-central/source/widget/nsTransferable.cpp#248,256
Anyone has any idea?
Comment 28•5 years ago
|
||
Where do the n^2 calls come from? I don't see a loop in the M-C code. Can you attach the debugger to it?
Comment 29•5 years ago
|
||
Assignee | ||
Comment 30•5 years ago
|
||
Here is the flow of the whole event:
-
When attachments get dragged, setupDataTransfer is called to add the data in event.dataTransfer: https://searchfox.org/comm-central/source/mail/base/content/mailCore.js#841, https://searchfox.org/comm-central/source/mail/base/content/msgHdrView.js#3392
-
nsFlavorDataProvider object is saved as "application/x-moz-file-promise" event.dataTransfer. nsFlavorDataProvider interface has getFlavorData method. When you drop any item in the local machine, this should get the call(only once) and it will save the file into the local machine with the help of the saved data in event.dataTransfer: https://searchfox.org/comm-central/source/mail/base/content/mailCore.js#841,891,903,940
-
nsFlavorDataProvider interface is coming from here: https://searchfox.org/mozilla-central/source/widget/nsITransferable.idl#80
-
I checked with all the nsFlavorDataProvider instances. When you drop a file in the local machine,
nsTransferable::GetTransferData
is getting called and we have call todataProvider->GetFlavorData(this, aFlavor, getter_AddRefs(dataBytes));
there: https://searchfox.org/mozilla-central/source/widget/nsTransferable.cpp#248,253 -
I used printf statements to debug the code in nsTransferable::GetTransferData just like
printf("xxx nsTransferable::GetTransferData aFlavor=%s\n", aFlavor.get());
It was getting printed n^2 times always with aFlavor.get() is equal to application/x-moz-file-promise. I think once it's done, it should not pass the if statemenet here: https://searchfox.org/mozilla-central/source/widget/nsTransferable.cpp#253. But I don't know what does this if statement do/check.
Assignee | ||
Comment 31•5 years ago
|
||
It's working on MacOS. Can you check if it's not breaking anything on Linux?
Assignee | ||
Updated•5 years ago
|
Comment 32•5 years ago
|
||
Assignee | ||
Comment 33•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 34•5 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/4b7f17978f58
Fix drag & drop of multiple attachments creating duplicates in MacOS. r=mkmelin
Comment 35•5 years ago
|
||
Please don't forget uplift here.
Updated•5 years ago
|
Comment 36•5 years ago
|
||
Comment 37•5 years ago
|
||
Comment 38•5 years ago
|
||
Comment 39•5 years ago
|
||
bugherder uplift |
Thunderbird 79.0b2:
https://hg.mozilla.org/releases/comm-beta/rev/ef7205c5cdd2
Updated•5 years ago
|
Comment 40•5 years ago
|
||
bugherder uplift |
Thunderbird 78.0.1:
https://hg.mozilla.org/releases/comm-esr78/rev/4d03a662e43f
Comment 41•5 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #37)
Comment on attachment 9160599 [details] [diff] [review]
Bug-1494588_dnd-multiple-items-mac-1.patchApproved for beta
Eckard, can you test this when we smoketest beta?
I can't reproduce this issue in TB 79.0b3.
Description
•