Closed Bug 1625260 Opened 4 years ago Closed 4 years ago

When opening a draft message, enigmail code thinks composer is dirty, despite no changes

Categories

(MailNews Core :: Security: OpenPGP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 76.0

People

(Reporter: KaiE, Assigned: KaiE)

References

Details

Attachments

(1 file)

This test fails with the enigmail code enabled:
comm/mail/test/browser/composition/browser_draftIdentity.js

This is caused by a difference how a message is treated, that was opened from a draft message.

Steps to reproduce:

  • compose a message
  • save as draft
  • close message
  • find message in draft folder
  • click the edit button
  • in the compose that opened, use file close

Expected behavior:
Composer window gets closed immediately, no prompt.
(That makes sense, nothing in composer was changed.)

Actual behavior with Enigmail code enabled:
A prompt is shown to confirm that the user wants to discard the message.

This behavior is independent of saying drafts as plain text or encrypted, and can be reproduced with TB 68 and enigmail, too, as well an with the latest nightly code.

also affects:
comm/mail/test/browser/composition/browser_saveChangesOnQuit.js

The Enigmail code always updates the message subject when opening a draft message, regardless if the loaded subject needs to be replaced or not. Then it calls subject.oninput() which unconditionally sets the gContentChanged variable.

A fix is to avoid updating the subject if it's unnecessary.

Attached patch 1625260-v1.patchSplinter Review
Assignee: nobody → kaie
Attachment #9136326 - Flags: review?(patrick)
Comment on attachment 9136326 [details] [diff] [review]
1625260-v1.patch

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

There is still an unnecessary console.debug() statement.
Attachment #9136326 - Flags: review?(patrick) → review+

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/9e8aed12d503
Avoid unnecessary dirty message state after draft message. r=PatrickBrunschwig DONTBUILD

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 76.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: