compose.onAfterSend not always called
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
People
(Reporter: G.Gersdorf, Assigned: john)
References
Details
Attachments
(3 files, 1 obsolete file)
Steps to reproduce:
Have two add-ons which adds a listener for compose.onAfterSend
Actual results:
Only one listener is called. The other fails in the onSuccess block on the line
https://searchfox.org/comm-central/source/mail/components/extensions/parent/ext-compose.js#1474
TB than continues to the onFailure block but also fails at the same statement.
Expected results:
Both listeners should be called.
| Reporter | ||
Comment 1•2 months ago
|
||
This bug prevents two of my add-ons from coexisting...
| Assignee | ||
Comment 2•2 months ago
|
||
Thanks for the report, Günter. Which two add-ons are that? Could you check this in Daily, if it may have been fixed by bug 1959939? I changed the order of some calls, which were different compared to the onBeforeSend event.
| Reporter | ||
Comment 3•2 months ago
|
||
| Reporter | ||
Comment 4•2 months ago
|
||
| Reporter | ||
Comment 5•2 months ago
|
||
Tested with daily 2025-11-16 and fresh profile: No change, only one add-on is called.
I've tested with two nearly identical minimal add-ons, see attachments. Only the console message from the first installed add-on is shown.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 6•2 months ago
|
||
Updated•2 months ago
|
| Assignee | ||
Comment 7•2 months ago
|
||
The compose window may be destroyed while the event result is still being
prepared asynchronously, which could cause some listeners to not notify
their handlers.
This patch introduces the onConvertSync callback, which is executed while
the compose window is guaranteed to exist. Because this callback must be
called from inside MsgOperationObserver, the calls to the other callbacks
(onSuccess and onFailure) have also been moved there.
Updated•2 months ago
|
| Reporter | ||
Comment 8•2 months ago
|
||
Will this approach garantee that information i have added to the compose window via messenger.sessions.setTabValue() are accessible in the onAfterSend listener?
| Assignee | ||
Comment 9•2 months ago
•
|
||
I don't think so, the window is probably destroyed by the time onAfterSend is called, which is the reason why the current implementation of the event fails for your second extension.
Edit: I added a note to the documentation.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 10•2 months ago
|
||
| Assignee | ||
Updated•2 months ago
|
Comment 11•2 months ago
|
||
Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/4c95576f4aaf
Fix race condition when multiple extensions register a listener for the compose.onAfterSend event. r=mkmelin
Updated•2 months ago
|
Description
•