Closed Bug 1710220 Opened 3 years ago Closed 3 years ago

Can't resave a draft/template message (with attachments) opened for editing for the second time.

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 90
defect

Tracking

(thunderbird_esr78 unaffected, thunderbird89 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
thunderbird_esr78 --- unaffected
thunderbird89 --- fixed

People

(Reporter: myaddons, Assigned: rnons)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

I was testing the latest development version of Thunderbird, i.e. Daily 90.0a1 (2021-05-08), in order to prepare my own add-on Mail Merge for the upcoming major release of Thunderbird 91.

I ran into a problem, that opened messages with attachments could not be saved as a draft or template. Further investigation showed this to be a problem directly in Thunderbird.

In a new profile:

  1. Create a new message with an attachment
  2. Save the message as a draft or template
  3. Close the message compose window
  4. Open the saved message
  5. Save the message as a draft or template - a first time
  6. Save the message as a draft or template - a second time

I get the following error message:

Unable to save your message as a draft.
There was an error attaching image.jpg. Please check that you have access to the file.

This problem also affects saving the message as a template as well. And it gets triggered by the "Auto Save" function, in case the user edits the opened message in between both auto save intervals.

I can reproduce this problem reliably in a new profile with both Windows 10 Version 20H2 Build 19042.964 (64bit) and Arch Linux (64bit) using Thunderbird Daily 90.0a1 (2021-05-08) (64bit). (It works in Thunderbird 78!)

In the /tmp folder on my Arch Linux system, once I open the saved message in step (4), a file "nsmail.jpg" is created. However, this file is being deleted, when I save the message as a draft or template for the first time in step (5).

I guess it is reasonable to assume, that this deletion of the file is responsible for the file not being found, when the message gets saved a second time in step (6).

In Thunderbird 78 the same temporary file gets created, when the message is opened in step (4). But the file does not get deleted, when the message is saved - for the first time in step (5) or the second time in step (6).

(In reply to Alexander Bergmann from comment #1)

In the /tmp folder on my Arch Linux system, once I open the saved message in step (4), a file "nsmail.jpg" is created. However, this file is being deleted, when I save the message as a draft or template for the first time in step (5).

I can confirm this for Windows.

In Thunderbird 78 the same temporary file gets created, when the message is opened in step (4). But the file does not get deleted, when the message is saved - for the first time in step (5) or the second time in step (6).

Agreed.

If I set the pref mailnews.send.jsmodule to FALSE it works also.

So a regression by Bug 1211292?
Ping Chen, could that be the case?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(remotenonsense)
Keywords: regression
Summary: Error saving an opened message with attachments as a draft or template → Can't resave a draft/template message (with attachments) opened for editing for the second time.

Thanks, will make a fix soon.

Assignee: nobody → remotenonsense
Status: NEW → ASSIGNED
Flags: needinfo?(remotenonsense)
Regressed by: 1211292
Blocks: 1710323

When editing a draft containing attachments, a temporary file is created for each attachment. If those temporary files are removed, saving for the second time fails.

Target Milestone: --- → 90 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/9cf86ddb673c
Do not remove temporary attachment files in MimePart.jsm. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9221026 [details]
Bug 1710220 - Do not remove temporary attachment files in MimePart.jsm. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): bug 1211292
User impact if declined: When re-editing a draft with attachments, saving it for the second time fails
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): Low

Attachment #9221026 - Flags: approval-comm-beta?

Comment on attachment 9221026 [details]
Bug 1710220 - Do not remove temporary attachment files in MimePart.jsm. r=mkmelin

[Triage Comment]
Approved for beta

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

Attachment

General

Created:
Updated:
Size: