Open Bug 1744709 Opened 1 year ago Updated 4 months ago

File saved via double-click in the attachment area doesn't show in the list of saved files (Ctrl+J)

Categories

(Thunderbird :: Mail Window Front End, defect)

Thunderbird 96
defect

Tracking

(thunderbird_esr102+ affected)

REOPENED
107 Branch
Tracking Status
thunderbird_esr102 + affected

People

(Reporter: rachel, Assigned: aceman, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

When saving a file via double-click from the attachment area, the file doesn't appear in the list of saved files any more. Visible in TB 95 beta.

Likely a regression of bug 1737711.

Keywords: regression
Regressed by: 1737711

Maybe something like this or this is missing here? Looks like the transfer stuff creates the download (entry) here (line 413).

Status: UNCONFIRMED → NEW
Ever confirmed: true

TB 91 is affected.

Geoff, maybe TB should eventually take this patch before 102 since it's a regression from the "open attachment reshuffle". Likely needs rebasing to trunk. (Strange that no user complained since we got a complaint very early on.)

We want to create an item in the downloads history aka "Saved Files" every time
when an attachment get saved, so that users won't have to dig for that file
again.

https://github.com/Betterbird/thunderbird-patches/blob/main/102/bugs/1744709-save-double-click-download.patch

Assignee: nobody → bugzilla2007
Status: NEW → ASSIGNED

(In reply to Rachel Martin from comment #5)

Geoff, maybe TB should eventually take this patch before 102 since it's a regression from the "open attachment reshuffle". Likely needs rebasing to trunk. (Strange that no user complained since we got a complaint very early on.)

Thanks Rachel for following up on this and offering your patch! This is a useful fix for an everyday basic workflow.
Geoff is on holiday for the next two weeks. I've applied this in my new (Artifact) Build Environment, and it does fix the problem without any side effects afasics. Patch uploaded for review. Awesome!

It would be preferable to keep passing in the path, instead of adding more reliance on nsIFile

nsITransfer,init() requires a nsIURI parameter, so it doesn't make sense to pass the nsIFile.path instead of nsIFile just to create another nsIFile inside the function to create the URI.

I have simplified the patch to keep using the file path instead of nsIFile. It seems to work for me on Linux. Please test on Windows, whether the constructed URI is correct and the downloads list opens the correct folder where the file was stored.

Attachment #9297023 - Flags: feedback?(b2)
Comment on attachment 9297023 [details] [diff] [review]
1744709-save-double-click-download.patch

Review of attachment 9297023 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, works on Windows.

::: mail/base/content/msgHdrView.js
@@ +1554,5 @@
>        async function saveToFile(path) {
>          let buffer = await new Promise(function(resolve, reject) {
>            NetUtil.asyncFetch(
>              {
>                uri: Services.io.newURI(url),

Please use `sourceURI` here like in our original patch.
Attachment #9297023 - Flags: feedback?(b2) → feedback+

Thanks, updated the patch.

Attachment #9271879 - Attachment is obsolete: true
Attachment #9297023 - Attachment is obsolete: true
Attachment #9297706 - Flags: review?(mkmelin+mozilla)
Assignee: bugzilla2007 → acelists
Target Milestone: --- → 107 Branch

Comment on attachment 9297706 [details] [diff] [review]
1744709-save-double-click-download.patch v2

Looks good to me, r=mkmelin

Attachment #9297706 - Flags: review?(mkmelin+mozilla) → review+

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/c8e4b4cb97f8
Create a download when saving to file via double-click.

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Attachment #9271879 - Attachment is obsolete: false
Attachment #9271879 - Attachment is obsolete: true

This breaks the test mail/test/browser/attachment/browser_openAttachment.js on Linux/Mac systems. Looks like the file permissions aren't what was expected.

Status: RESOLVED → REOPENED
Flags: needinfo?(acelists)
Resolution: FIXED → ---
You need to log in before you can comment on or make changes to this bug.