Closed Bug 1467263 Opened 6 years ago Closed 6 years ago

dragging an inaccessible file into compose attachments throws

Categories

(Thunderbird :: Message Compose Window, defect)

defect
Not set
minor

Tracking

(thunderbird_esr60 fixed, thunderbird60 fixed, thunderbird61 wontfix, thunderbird62 fixed)

RESOLVED FIXED
Thunderbird 62.0
Tracking Status
thunderbird_esr60 --- fixed
thunderbird60 --- fixed
thunderbird61 --- wontfix
thunderbird62 --- fixed

People

(Reporter: aceman, Assigned: aceman)

Details

Attachments

(2 files)

If you drag a file that will not be accessible to Thunderbird into its compose window attachment bucket, there will be just an exception at MsgComposeCommands.js, line 6080 (size = rawData.fileSize;) .

This can happen e.g. if you run TB under one user in the OS, and drag the file from a file explorer under a different user. This is easy to do on Linux, but should also be reproducible on Windows/OS X.
Attached patch 1467263.patchSplinter Review
This checks if the dragged file is readable to the app.

Strangely, I got different results even when using the same file. At first (thus this bug) I got the exception about not being able to read the file size. But later on, TB added the attachment into the list. But it wasn't really readable and I got a complaint in a dialog when trying to save/send the message as that was the time TB was actually trying to read the file contents.

Is this patch OK as it is, just adding a message into the console? I fix this to not abort with an exception in the middle of the envelopeDragObserver::onDrop() function. I wanted to catch this case and make the code continue, cleanly handling if the attachment isn't usable. So if it isn't no attachment is added to the list. This is similar as when you try to add the same attachment again. So this is why I need UI decision on this.
Attachment #8983931 - Flags: ui-review?(richard.marti)
Attachment #8983931 - Flags: review?(jorgk)
Comment on attachment 8983931 [details] [diff] [review]
1467263.patch

Looks good. Thanks.
Attachment #8983931 - Flags: review?(jorgk) → review+
Comment on attachment 8983931 [details] [diff] [review]
1467263.patch

This is probably a very seldom case (it seems to be the first such bug report), so a console message is okay. And maybe you're planning to land it for TB 60 too where no new strings are allowed.
Attachment #8983931 - Flags: ui-review?(richard.marti) → ui-review+
Attachment #8983931 - Flags: approval-comm-esr60+
Attachment #8983931 - Flags: approval-comm-beta+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/25772af3b0a5
check if dragged file being attached is readable. r=jorgk, ui-r=Paenglab
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 62.0
Attached patch 1467263-2.patchSplinter Review
Sorry, a typo :(
Attachment #8984027 - Flags: review?(jorgk)
Comment on attachment 8984027 [details] [diff] [review]
1467263-2.patch

:-(
Attachment #8984027 - Flags: review?(jorgk) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/ba8e0e2ddfda
Follow-up: fix typo. r=jorgk DONTBUILD
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: