Closed
Bug 1250605
Opened 9 years ago
Closed 9 years ago
Fix some "gMsgCompose is undefined" TypeErrors
Categories
(Thunderbird :: Message Compose Window, defect)
Thunderbird
Message Compose Window
Tracking
(thunderbird45 fixed, thunderbird46 fixed, thunderbird47 fixed)
RESOLVED
FIXED
Thunderbird 47.0
People
(Reporter: aleth, Assigned: aleth)
References
Details
Attachments
(1 file, 1 obsolete file)
1.95 KB,
patch
|
jorgk-bmo
:
review+
jorgk-bmo
:
approval-comm-aurora+
jorgk-bmo
:
approval-comm-esr45+
|
Details | Diff | Splinter Review |
TypeError: gMsgCompose is null in MsgComposeCommands.js
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8722601 -
Flags: review?(mozilla)
Comment 2•9 years ago
|
||
How do your reproduce the problem? Are we hiding a deeper problem here?
Assignee | ||
Comment 3•9 years ago
|
||
This happens when you have used message compose and then quit with no open compose window, as the messageComposeOfflineQuitObserver fires and calls ComposeCanClose. In this circumstance the minimal changes I made make sense.
I guess the observer isn't removed at the same time as gMsgCompose because it's possible that the message is still being sent despite the composer being closed, but I don't know that code flow well enough to know.
Comment 4•9 years ago
|
||
I've been trying to reproduce the bug for a long time. I close the application by clicking on the (x) on the main window. That doesn't reproduce the bug.
I can however reproduce it by opening a compose window, closing it without doing anything and then closing the application from the File menu. I guess Apple people just type (Apple)Q.
May I suggest another patch:
Do not call ComposeCanClose() from messageComposeOfflineQuitObserver() if !gMsgCompose.
If no composition is in progress it makes no sense to ask if the composition can be closed. Alternatively, return from ComposeCanClose() straight away. I'm undecided, maybe the second option is best, like:
// Huh? Composition already gone away, nothing to test here.
if (!gMsgCompose)
return.
Can you do my another favour. I've been playing around with this and closed both main window and composition window while a send was still in progress (sent 10 MB worth of pictures). This resulted in:
JavaScript error: chrome://messenger/content/messengercompose/MsgComposeCommands.js, line 167: TypeError: gMsgCompose is null
The line number may be wrong due to my added debug. It's in updateEditableFields(). There we should have a:
if (!gMsgCompose) return.
Comment 5•9 years ago
|
||
Sorry, return true in the first case.
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8722720 -
Flags: review?(mozilla)
Assignee | ||
Updated•9 years ago
|
Attachment #8722601 -
Attachment is obsolete: true
Attachment #8722601 -
Flags: review?(mozilla)
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #4)
> May I suggest another patch:
> Do not call ComposeCanClose() from messageComposeOfflineQuitObserver() if
> !gMsgCompose.
> If no composition is in progress it makes no sense to ask if the composition
> can be closed. Alternatively, return from ComposeCanClose() straight away.
Good idea.
The number of gMsgCompose checks in this file makes me suspect the code is badly structured in some way though. There is also no shutdown blocker, so I hope the mechanism that ensures sends complete during shutdown is robust enough...
Comment 8•9 years ago
|
||
Comment on attachment 8722720 [details] [diff] [review]
Fix some "gMsgCompose is undefined" TypeErrors
Review of attachment 8722720 [details] [diff] [review]:
-----------------------------------------------------------------
This makes more sense, don't you think?
Attachment #8722720 -
Flags: review?(mozilla) → review+
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #8)
> Comment on attachment 8722720 [details] [diff] [review]
> Fix some "gMsgCompose is undefined" TypeErrors
>
> Review of attachment 8722720 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> This makes more sense, don't you think?
See comment 7 ;)
Comment 10•9 years ago
|
||
Looks like wires crossed here a bit.
Let me remove the recycling in bug 777732 and we will have less complexity. The logic will be simpler then: Open a window, do stuff, close and destroy it and all that goes with it. No funny recycled/hidden stuff hanging around.
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #10)
> Looks like wires crossed here a bit.
>
> Let me remove the recycling in bug 777732 and we will have less complexity.
> The logic will be simpler then: Open a window, do stuff, close and destroy
> it and all that goes with it. No funny recycled/hidden stuff hanging around.
Ah, I guess that explains it :-)
Comment 12•9 years ago
|
||
Yes, what you saw was the observer of the recycled window being run. If you click on the (x) on the main window, the observer is removed before it triggers, not so via "Exit" from the menu. I added a lot of debug to see what happens ;-(
Assignee | ||
Comment 13•9 years ago
|
||
https://hg.mozilla.org/comm-central/rev/599fd18da6c144abcc9b7feec4ee30b92e9d7bfc
Bug 1250605 - Fix some "gMsgCompose is undefined" TypeErrors. r=jorgk
Assignee | ||
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 47.0
Comment 14•9 years ago
|
||
Comment on attachment 8722720 [details] [diff] [review]
Fix some "gMsgCompose is undefined" TypeErrors
[Approval Request Comment]
Regression caused by (bug #): No regression, wrong from day one.
Risk to taking this patch (and alternatives if risky):
Not risky, just adverting JS runtime errors due to access via variable with is null.
Attachment #8722720 -
Flags: approval-comm-beta?
Attachment #8722720 -
Flags: approval-comm-aurora+
Comment 15•9 years ago
|
||
Aurora (TB 46):
https://hg.mozilla.org/releases/comm-aurora/rev/b491a878367b
Landed with DONTBUILD since I want to try put the self-service at
https://secure.pub.build.mozilla.org/buildapi/self-serve
status-thunderbird45:
--- → affected
status-thunderbird46:
--- → fixed
status-thunderbird47:
--- → fixed
Comment 16•9 years ago
|
||
s/try put/try out/
I visited https://secure.pub.build.mozilla.org/buildapi/self-serve/comm-aurora and requested a new nightly build for rev b491a878367b. See what happens tomorrow.
Comment 17•9 years ago
|
||
Comment on attachment 8722720 [details] [diff] [review]
Fix some "gMsgCompose is undefined" TypeErrors
http://hg.mozilla.org/releases/comm-esr45/rev/dcc36613598f
Attachment #8722720 -
Flags: approval-comm-beta? → approval-comm-beta+
Updated•9 years ago
|
Updated•9 years ago
|
Attachment #8722720 -
Flags: approval-comm-beta+ → approval-comm-esr45+
You need to log in
before you can comment on or make changes to this bug.
Description
•