Closed Bug 741208 Opened 14 years ago Closed 14 years ago

NotifyComposeBodyReady not called when Forwarding or Edit as New

Categories

(Thunderbird :: Message Compose Window, defect)

11 Branch
defect
Not set
normal

Tracking

(thunderbird13-, thunderbird14-)

RESOLVED INVALID
Tracking Status
thunderbird13 - ---
thunderbird14 - ---

People

(Reporter: patrick, Assigned: Bienvenu)

References

Details

When using "Edit as new" or Forward message(at least inline forwarding), and the compose window is recycled then stateListeners registered with RegisterStateListener do not receive a NotifyComposeBodyReady event. When doing the same with new window, and when using "reply" the event is fired as expected. Steps to reproduce: 1. Use Edit as new (and close window again) 2. Use Edit as new again Enigmail needs this event in order to trigger decryption.
Looks like it is fixed in 13 alpha, right?
Using 13.0a2, 2012-04-02 the problem is not fixed.
You are right. I don't know why I didn't see the bug.
Setting the flag as enigmail is a big use case for Thunderbird.
So what's an approximate regression range? The version field says 11, was it seen in that and 12, or has this only come up in 13?
According to bug 729034 this is visible since TB 10. It's certainly visible in 11-13
I'm going to see if David can take a look at this in the next cycle. Getting a regression window/bug would probably be a great help.
Assignee: nobody → dbienvenu
This is working for me - we send the event every time, whether or not the compose window is recycled, and for all composition types (reply, forward inline, edit message as new). By WFM, I mean we hit the ComposeBodyReady case in nsMsgCompose::NotifyStateListeners every time. Is it possible that you're not registering your listener in the reusing a recycled compose window case?
Patrick, can you tell me what causes you to register your listener? We don't unregister listeners when we cache compose windows, from what I can tell.
Here is the stripped down code related to (un)registering: window.addEventListener("load", function _enigmail_composeStartup (event) { // ... gMsgCompose.RegisterStateListener(Enigmail.composeStateListener); // ... }, false); window.addEventListener("unload", function _enigmail_composeUnload (event) { // ... if (gMsgCompose) gMsgCompose.UnregisterStateListener(Enigmail.composeStateListener); // ... }, false); Enigmail.composeStateListener = { NotifyComposeFieldsReady: ... ComposeProcessDone: ... NotifyComposeBodyReady: ... SaveInFolderDone: ... };
Forgot this one: window.addEventListener('compose-window-reopen', function _enigmail_msgComposeReopen (event) { gMsgCompose.RegisterStateListener(Enigmail.composeStateListener); }, true);
Patrick, have you verified that this doesn't work for you on trunk builds? The report only mentions tb 13 alpha.
Patrick, could you put some dumps in your code to see when you're registering and unregistering when reproducing this bug?
Still the same on 15.0a1 (2012-06-01). This is the log extract from Enigmail: 2012-06-01 17:25:51.373 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.composeOpen (got event load) 2012-06-01 17:25:51.374 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.composeOpen: done RegisterStateListener 2012-06-01 17:25:51.585 [DEBUG] enigmailMsgComposeOverlay.js: ECSL.NotifyComposeFieldsReady 2012-06-01 17:25:51.595 [DEBUG] enigmailMsgComposeOverlay.js: ECSL.ComposeBodyReady 2012-06-01 17:25:55.833 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.msgComposeClose (got event compose-window-close) 2012-06-01 17:26:00.163 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.msgComposeReopen (got event compose-window-reopen) 2012-06-01 17:26:00.166 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.composeReopen: done RegisterStateListener 2012-06-01 17:26:04.905 [DEBUG] enigmailMsgComposeOverlay.js: Enigmail.msg.msgComposeClose (got event compose-window-close) ECSL is the ComposeStateListener
I installed enigmail and debugged this a bit. In the problem case, the issue is that you're registering your listener after we send the body ready notification, so you're not going to get a notification.
oh, and in this case, it seems that we have the body all ready to go on load, unlike reply, which quotes asynchronously.
(In reply to David :Bienvenu from comment #16) > I installed enigmail and debugged this a bit. In the problem case, the issue > is that you're registering your listener after we send the body ready > notification, so you're not going to get a notification. Are you telling me that I should listen to an earlier event (if there is any), or is it something for you to fix in Thunderbird?
(In reply to Patrick Brunschwig from comment #18) > Are you telling me that I should listen to an earlier event (if there is > any), or is it something for you to fix in Thunderbird? listen for an earlier event, if there is one; if not, we need to figure out a way for there to be one, or a way to make what you want to do possible in the case of recycled compose windows.
Thanks a lot for your help :-) I found that the "compose-window-init" event is fired earlier than "compose-window-reopen", so I'll use that.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.