gMsgCompose.bodyModified is set by selecting different `from` identity
Categories
(Thunderbird :: Message Compose Window, defect)
Tracking
(Not tracked)
People
(Reporter: axel.grude, Unassigned)
Details
Description:
Selecting a different “From” identity in the composer sets gMsgCompose.bodyModified to true, even if the user has not typed anything in the message. As a result, Thunderbird prompts the user to save the message on close, even though nothing was modified.
Steps to Reproduce:
- Open a new message in Thunderbird.
- Do not type anything in the body.
- Change the “From” identity using the identity chooser (even selecting the same suggested identity).
- Close the composer.
Actual Result:
- The user is prompted to save the message.
gMsgCompose.bodyModifiedis set to true, despite no user input.
Expected Result:
- The composer should not prompt to save if the user has typed nothing.
gMsgCompose.bodyModifiedshould remain false unless the user actually modifies the message body.
Notes:
- This behavior also affects add-ons that rely on
gMsgCompose.bodyModifiedto detect user changes or modify identity (e.g., Identity Picker, SmartTemplates). - see the API compose.setComposeDetails() - if it is used to set the from identity, even adding
isModified:falseto the details structure does not help - Thunderbird back end code will still immediately set thebodyModified. Technically I feel this is a wrong setting of a flag that governs "content" not structure. The user has not inserted any data only selected an identity - asking to save is bad UX. - It appears independent of any add-on and occurs in vanilla Thunderbird as well.
| Reporter | ||
Updated•3 months ago
|
Comment 1•3 months ago
•
|
||
This was deliberately changed in bug 1850192. Setting isModified to false with compose.setComposeDetails() should work (at least in my add-on it does…).
Updated•3 months ago
|
| Reporter | ||
Comment 2•3 months ago
|
||
(In reply to Hartmut Welpmann [:welpy-cw] from comment #1)
This was deliberately changed in bug 1850192. Setting
isModifiedtofalsewithcompose.setComposeDetails()should work (at least in my add-on it does…).
It doesn't work during the call (I patched identity picker which only sets the send to put isModified:false at the same time) - this is ignored and set to true anyway.
that's not good - I have a listener that consumes the "compose-from-changed" event - at that stage (immediately after selecting a different from or when the other Add-on identity picker selects a from) the isModified is set to true. My Add-on applies new templates (which completely rebuilds the email) and wants to avoid deleting anything the user has typed, but i do not know whether it was or not at this stage.
| Reporter | ||
Comment 3•3 months ago
•
|
||
Instead of flagging as RESOLVED/INVALID, Can we convert this issue into a feature request to turn off the behavior (Thunderbird setting isBodyModified=true before firing compose-from-changed event) or should I create a new bug request?
Also I would like the compose API to not ignore the isModified:false when it decides to change "from" in the same call - that would also fix the permanent problem in "identity picker" (And the add-on owner could expose this as an option on their end) - at least then there wouldn't be additional UI on the Thunderbird side.
Description
•