Closed Bug 1617022 Opened 5 years ago Closed 5 years ago

compose.onBeforeSend listener doesn't actually change composed message

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

defect
Not set
normal

Tracking

(thunderbird74 fixed)

RESOLVED FIXED
Thunderbird 75.0
Tracking Status
thunderbird74 --- fixed

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

Attachments

(1 file)

Due to a series of mistakes, trying to change a message with an onBeforeSend listener doesn't actually do anything. This needs proper automated tests.

The actual mistakes are fixed by this bit:

-          setComposeState(composeWindow, result.details);
+          await setComposeDetails(composeWindow, result.details);
+          composeWindow.GetComposeDetails();

The first mistake was forgetting to await setComposeDetails. The second was not actually updating the details for the send function (which we interrupted to get here).

Also in this patch I've renamed setComposeState to setComposeDetails which I'd intended to do before but missed.

And I've beefed up the test. It now actually "sends" messages (send later), then reads the sent message from the outbox.

Attachment #9128073 - Flags: review?(mkmelin+mozilla)
Attachment #9128073 - Flags: approval-comm-beta?
Blocks: 1613534
Comment on attachment 9128073 [details] [diff] [review] 1617022-change-before-send-1.diff Review of attachment 9128073 [details] [diff] [review]: ----------------------------------------------------------------- LGTM, r=mkmelin
Attachment #9128073 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → Thunderbird 75.0

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/75aa7d5dbcfd
Make compose.onBeforeSend listener actually change composed message. r=mkmelin DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Comment on attachment 9128073 [details] [diff] [review] 1617022-change-before-send-1.diff [Triage Comment] broken tests
Attachment #9128073 - 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: