web-ext run fails intermittently
Categories
(GeckoView :: Extensions, defect, P1)
Tracking
(firefox75 fixed)
| Tracking | Status | |
|---|---|---|
| firefox75 | --- | fixed |
People
(Reporter: csadilek, Assigned: agi)
Details
(Whiteboard: [geckoview:m75])
Attachments
(1 file)
We're seeing intermittent failures of web-ext run caused by:
o: Remote Firefox: listTabs() error: unknownError: can't access property "selectedBrowser", aWindow.BrowserApp is undefined
at /usr/local/lib/node_modules/web-ext/dist/web-ext.js:1:5319
at /usr/local/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client-methods.js:73:9
at Client.handleMessage (/usr/local/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client.js:162:7)
at Client.readMessage (/usr/local/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client.js:221:10)
at Client.onData (/usr/local/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client.js:187:16)
at Socket.emit (events.js:321:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:273:9)
at Socket.Readable.push (_stream_readable.js:214:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
This is reproducible on GeckoViewExample as well.
| Assignee | ||
Updated•5 years ago
|
Comment 1•5 years ago
•
|
||
(In reply to Christian Sadilek [:csadilek] from comment #0)
We're seeing intermittent failures of web-ext run caused by:
o: Remote Firefox: listTabs() error: unknownError: can't access property "selectedBrowser", aWindow.BrowserApp is undefined ...
As I mentioned to Christian, this error is very likely thrown from here: https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/mobile/android/modules/dbg-browser-actors.js#82
Looking at the blame for that line, it looks it is coming directly from Fennec (introduced by Bug 909782), which makes sense given that BrowserApp was originally part of the Fennec internals.
In GeckoView that BrowserApp global is lazily created here from GeckoViewTab.jsm:
and so my guess is that web-ext is triggering a race between the "remote debugging server calling listTabs" (because web-ext run is quickly connecting to the RemoteDebuggingServer are soon as it is reachable) and "BrowserApp global being created by GeckoViewTab.jsm".
This issue looks something that we should fix in dbg-browser-actors.js, e.g. we could either:
-
import
GeckoViewTab.jsmfromdbg-browser-actors.jsand then useBrowserAppShim.getBrowserApp(window)to get theBrowserAppobject for a given window (and avoid the race that is likely triggering the error), but it is worth to mention thatBrowserAppShimdoesn't provide atabsproperty and soMobileTabList.prototype._getChildrenwould still be broken (it seems to be used here to iterate over all the tabs). -
or remove any usage of BrowserApp from it (and replace with a more "GeckoView"-way of implementing those methods)
Updated•5 years ago
|
| Assignee | ||
Comment 2•5 years ago
|
||
In GeckoView every window has always exactly only one browser. Also selectedTab
is not defined.
Updated•5 years ago
|
Comment 4•5 years ago
|
||
| bugherder | ||
Description
•