Closed Bug 1744709 Opened 2 years ago Closed 10 months ago

File saved via save attachment 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+ wontfix, thunderbird115 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
thunderbird_esr102 + wontfix
thunderbird115 --- fixed

People

(Reporter: rachel, Assigned: mkmelin)

References

(Regressed 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file, 5 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: 2 years 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 → ---

Rebased patch. Magnus, can you please check the test failures, see comment #15.

Attachment #9331110 - Flags: feedback?(mkmelin+mozilla)

Rebased after prettier changes.

Coming back to this bug, I don't think the bug as filed is 100% correct. We should only save to that list when the it's a save. If you open a temp file it shouldn't get into that list.

Assignee: acelists → mkmelin+mozilla
Flags: needinfo?(acelists)
Summary: File saved via double-click in the attachment area doesn't show in the list of saved files (Ctrl+J) → File saved via save attachment in the attachment area doesn't show in the list of saved files (Ctrl+J)
Target Milestone: 107 Branch → 116 Branch
Attachment #9331110 - Attachment is obsolete: true
Attachment #9331110 - Flags: feedback?(mkmelin+mozilla)
Attachment #9297706 - Attachment is obsolete: true
Attachment #9335120 - Attachment is obsolete: true

(In reply to Magnus Melin [:mkmelin] from comment #19)

We should only save to that list when the it's a save. If you open a temp file it shouldn't get into that list.

We had feedback that in TB 78 the file was put into the list even if it was opened via double click and temporarily saved. Apparently the user preferred to re-open the attachment from the "Saved Files" menu rather than looking to the message again. But sure, referring to the temp directory which is subject to garbage collection isn't a stable solution.

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/80da1fdec431
Make saved attachments show up under Saved Files. r=aleca

Status: REOPENED → RESOLVED
Closed: 2 years ago10 months ago
Resolution: --- → FIXED
Regressions: 1840713

Comment on attachment 9340002 [details]
Bug 1744709 - Make saved attachments show up under Saved Files. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9340002 - Flags: approval-comm-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: