Bug: JavaScript Error: "can't access property "id", nativeTabInfo.browser is undefined" {file: "chrome://messenger/content/parent/ext-mail.js" line: 504
Status: RESOLVED
Priority: --
Resolution: WORKSFORME
Created: 2020-06-28 20:22:53+00:00
Resolved: 2021-02-05 01:15:38+00:00

I started to see the following error message starting on June 6 during my local mochitest run of C-C TB debug version.
I did not see it on May 30th. So this is relatively new.

Console message: [JavaScript Error: "can't access property "id", nativeTabInfo.browser is undefined" {file: "chrome://messenger/content/parent/ext-mail.js" line: 505}]

The error happens during the local execution of
comm/mail/components/extensions/test/browser/browser_ext_tabs_events.js
twice. The stack dump printed during the test:
```
59:15.23 TEST_START: comm/mail/components/extensions/test/browser/browser_ext_tabs_events.js
59:15.24 INFO Entering test bound
59:15.25 GECKO(466041) {streamdebug} closing: unusedDB (= 0x7fe5d4232480 )->Close() 'before Close(true)' in CreateFolder  at line 122 of /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgBrkMBoxStore.cpp
         ...

...
59:28.86 INFO Remove the first content tab. This was not active so no new tab should be activated.
59:29.34 GECKO(466041) [466041, Main Thread] WARNING: '!inner', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/dom/ipc/JSWindowActorProtocol.cpp, line 172
59:29.55 INFO ["onRemoved",70,{"windowId":3,"isWindowClosing":false}]
59:29.56 INFO Remove the second content tab. This was active, and the calendar tab is after it, so that should be activated.
59:29.82 INFO ["onRemoved",71,{"windowId":3,"isWindowClosing":false}]
59:29.82 INFO ["onActivated",{"tabId":72,"windowId":3}]
59:29.83 INFO Remove the remaining tabs.
59:29.83 INFO Console message: [JavaScript Error: "can't access property "id", nativeTabInfo.browser is undefined" {file: "chrome://messenger/content/parent/ext-mail.js" line: 504}]
_handleTabDestroyed@chrome://messenger/content/parent/ext-mail.js:504:12
emit@resource://gre/modules/ExtensionCommon.jsm:327:32
emitRemoved@chrome://messenger/content/parent/ext-mail.js:718:10
handleEvent@chrome://messenger/content/parent/ext-mail.js:567:16
closeTab@chrome://messenger/content/tabmail.js:1224:15
remove@chrome://messenger/content/parent/ext-tabs.js:446:21
recvAPICall/result</<@resource://gre/modules/ExtensionParent.jsm:877:68
withPendingBrowser@resource://gre/modules/ExtensionParent.jsm:483:26
recvAPICall/result<@resource://gre/modules/ExtensionParent.jsm:877:24
callAndLog@resource://gre/modules/ExtensionParent.jsm:839:14
recvAPICall@resource://gre/modules/ExtensionParent.jsm:876:25
Async*_recv@resource://gre/modules/ConduitsChild.jsm:78:20
receiveMessage@resource://gre/modules/ConduitsParent.jsm:357:20
JSActor query*_send@resource://gre/modules/ConduitsChild.jsm:63:11
_send@resource://gre/modules/ConduitsChild.jsm:111:18
callParentAsyncFunction@resource://gre/modules/ExtensionChild.jsm:826:18
callAsyncFunction@resource://gre/modules/ExtensionChild.jsm:590:33
stub@resource://gre/modules/Schemas.jsm:2682:30
@moz-extension://bbb6108b-787e-4055-99f8-52381f6d712f/%7Bd10b4271-a198-44a8-be88-b02faf556b33%7D.js:269:28
async*@moz-extension://bbb6108b-787e-4055-99f8-52381f6d712f/%7Bd10b4271-a198-44a8-be88-b02faf556b33%7D.js:283:7

59:29.97 INFO ["onRemoved",73,{"windowId":3,"isWindowClosing":false}]
59:30.18 INFO ["onRemoved",75,{"windowId":3,"isWindowClosing":false}]
59:30.46 INFO ["onRemoved",76,{"windowId":3,"isWindowClosing":false}]
59:30.64 GECKO(466041) {debug}:ASSERTION: ! (aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min), /NEW-SSD/NREF-COMM-CENTRAL/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line=762
59:30.64 GECKO(466041) aISizeType=2, BTLS_FINALSIZE=2
59:30.64 GECKO(466041) aISize=0, guess_min=10203, guess_pref=10203
59:30.64 GECKO(466041) parent at the position [2] is XULBox.
59:30.64 GECKO(466041) {debug} This strange situation is with XULBox Frame. Just ignore it for now.
         ...

59:30.80 INFO ["onRemoved",74,{"windowId":3,"isWindowClosing":false}]
59:30.80 INFO Console message: [JavaScript Error: "can't access property "id", nativeTabInfo.browser is undefined" {file: "chrome://messenger/content/parent/ext-mail.js" line: 504}]
_handleTabDestroyed@chrome://messenger/content/parent/ext-mail.js:504:12
emit@resource://gre/modules/ExtensionCommon.jsm:327:32
emitRemoved@chrome://messenger/content/parent/ext-mail.js:718:10
handleEvent@chrome://messenger/content/parent/ext-mail.js:567:16
closeTab@chrome://messenger/content/tabmail.js:1224:15
remove@chrome://messenger/content/parent/ext-tabs.js:446:21
recvAPICall/result</<@resource://gre/modules/ExtensionParent.jsm:877:68
withPendingBrowser@resource://gre/modules/ExtensionParent.jsm:483:26
recvAPICall/result<@resource://gre/modules/ExtensionParent.jsm:877:24
callAndLog@resource://gre/modules/ExtensionParent.jsm:839:14
recvAPICall@resource://gre/modules/ExtensionParent.jsm:876:25
Async*_recv@resource://gre/modules/ConduitsChild.jsm:78:20
receiveMessage@resource://gre/modules/ConduitsParent.jsm:357:20
JSActor query*_send@resource://gre/modules/ConduitsChild.jsm:63:11
_send@resource://gre/modules/ConduitsChild.jsm:111:18
callParentAsyncFunction@resource://gre/modules/ExtensionChild.jsm:826:18
callAsyncFunction@resource://gre/modules/ExtensionChild.jsm:590:33
stub@resource://gre/modules/Schemas.jsm:2682:30
@moz-extension://bbb6108b-787e-4055-99f8-52381f6d712f/%7Bd10b4271-a198-44a8-be88-b02faf556b33%7D.js:269:28
async*@moz-extension://bbb6108b-787e-4055-99f8-52381f6d712f/%7Bd10b4271-a198-44a8-be88-b02faf556b33%7D.js:283:7

59:30.95 INFO ["onRemoved",72,{"windowId":3,"isWindowClosing":false}]
59:30.96 INFO ["onActivated",{"tabId":1,"windowId":3}]
59:31.00 GECKO(466041) [466041, Main Thread] WARNING: '!inner', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/dom/ipc/JSWindowActorProtocol.cpp, line 172
59:31.12 INFO Leaving test bound

```

It is strange that I cannot find the message in try server jobs. 
Hmm. It is possible that some patches I applied to work around some other javascript errors might have let the program to proceed further then hit this issue, OR
more likely it can be timing dependent. Like, for example, nativeTabInfo.browser can be defined or yet defined based on some asynchronous layout/processing/loading of javascript, etc. (Surely I see Async*_recv in the stacktrace.)  That I see "Removed" in the log suggests that this may happen after a removal of a window or something? Ouch.