cloudfile.onFileUpload contains wrong fileName if attachment was renamed or forwarded
Categories
(Thunderbird :: FileLink, defect)
Tracking
(thunderbird_esr78 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | wontfix |
People
(Reporter: je, Assigned: je)
Details
Attachments
(2 files, 1 obsolete file)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
- Add an attachment to a message
- Rename it
- Upload it to a Filelink provider ("Convert to..." in the context menu)
Actual results:
The onFileUpload
event is triggered, with a CloudFile
object as the second parameter.
The name
property of this CloudFile
object contains the original name of the file attached. But the text inserted into the message along with the download url contains the new name.
So the name of the file in the cloud differs from the one in the message. This causes confusion or even security concerns for the receiver of the message.
Expected results:
The name
property of the CloudFile
object in the onFileUpload
event should contain the new name (the one the attachment was renamed to).
Comment 1•4 years ago
|
||
I've attached the file '''original_name.txt''' and renamed it to renamed_name.txt
Updated•4 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
There is another symptom of this bug:
- Receive a file called "sample.txt" as a regular attachent
- Choose to forward that message
- Convert the attachment to a Filelink attachment
The uploaded file now has a name like "nsmail.txt".
Again the problem is that the name
property of the Cloudfile
parameter in the onFileUpload
does not contain the correct name of the attachment as eg returned by messenger.compose.listAttachments
. Instead it contains the name of the local file.
Assignee | ||
Comment 3•3 years ago
|
||
Untested (as I can't get a dev env up). I have no idea if this passes any quality checks but it seems to solve the problem.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
Fixes both symptoms and tests pass.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Comment on attachment 9224094 [details] [diff] [review]
Adds attachment.name to uploadFile
Looks good! Thanks for the patch, sorry it took a while to get around to the review.
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/f56d4c959b5d
add attachment name to uploadFile() so that cloudfile will use correct name when attachment is renamed of forwarded. r=darktrojan
Description
•