Closed Bug 1589658 Opened 5 years ago Closed 3 years ago

`Error while calling actor 'domnode's method 'getEventListenerInfo' handlerDO.script is undefined` while clicking an event listener

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: itiel_yn8, Assigned: jdescottes)

Details

Attachments

(1 file)

STR:

  1. Open the network monitor
  2. Open YouTube
  3. Click any request item that has parameters
  4. Open the browser toolbox and inspect one of the parameters in the network monitor's sidebar
  5. In the toolbox's inspcetor navigate to its tr parent (class=treeRow)
  6. Click the event listener tooltip

AR:
Nothing happens and in the console these errors are logged:

Error while calling actor 'domnode's method 'getEventListenerInfo' handlerDO.script is undefined Actor.js:91:13
    writeError resource://devtools/shared/protocol/Actor.js:91
    handler resource://devtools/shared/protocol/Actor.js:192
    handler resource://devtools/shared/protocol/Actor.js:191
    _queueResponse resource://devtools/shared/protocol/Actor.js:107
    handler resource://devtools/shared/protocol/Actor.js:190
    onPacket resource://devtools/server/debugger-server-connection.js:378
    _onJSONObjectReady resource://devtools/shared/transport/transport.js:464
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:111
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:111

normalizeListener@resource://devtools/server/actors/inspector/event-collector.js:737:25
processHandlerForEvent@resource://devtools/server/actors/inspector/event-collector.js:929:22
getEventListeners@resource://devtools/server/actors/inspector/event-collector.js:869:14
getEventListeners@resource://devtools/server/actors/inspector/node.js:496:33
getEventListenerInfo@resource://devtools/server/actors/inspector/node.js:615:17
handler@resource://devtools/shared/protocol/Actor.js:154:37
onPacket@resource://devtools/server/debugger-server-connection.js:378:58
_onJSONObjectReady/<@resource://devtools/shared/transport/transport.js:464:22
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:111:22
Actor.js:96:15
    writeError resource://devtools/shared/protocol/Actor.js:96
    handler resource://devtools/shared/protocol/Actor.js:192
    handler resource://devtools/shared/protocol/Actor.js:191
    _queueResponse resource://devtools/shared/protocol/Actor.js:107
    handler resource://devtools/shared/protocol/Actor.js:190
    onPacket resource://devtools/server/debugger-server-connection.js:378
    _onJSONObjectReady resource://devtools/shared/transport/transport.js:464
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:111
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:111

ER:
Should have seen the event listeners.

Hi Mike, does this look familiar? I am wondering if this was a bug you were already working on or have previously seen during our triage.

Flags: needinfo?(mratcliffe)

Yup, that's my wheelhouse... I'm on it!

Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Flags: needinfo?(mratcliffe)
Has STR: --- → yes
OS: Unspecified → All
Priority: -- → P2
Hardware: Unspecified → All

This appears to be a Fission issue with the Omniscient Browser Debugger.

Inspecting events in some windows e.g. Markup View works just fine but Inspecting events in the Accessibility and Network panels fails.

This is the code that is run:

const ChromeDebugger = require("ChromeDebugger");
dbg = new ChromeDebugger();

... // Get an event listener (function)

if (handlerDO.boundTargetFunction) {
  handlerDO = handlerDO.boundTargetFunction;
}

const introScript = handlerDO.script.source.introductionScript;
const script = handlerDO.script;

At this point script is undefined for failing panels.

Assigning to the debugger team.

Assignee: mratcliffe → nobody
Status: ASSIGNED → NEW
Component: Inspector → Debugger

I can reproduce the problem only with Fission enabled.
(all prefs including devtools.testing.enableServerWatcherSupport)

Honza

Whiteboard: dt-fission-m3-mvp

Tracking dt-fission-m3-mvp bugs for Fission MVP.

Fission Milestone: --- → MVP

Honza: Just tested, this also fails without Fission & without the Multiprocess Browser Toolbox.
I think we can move it outside of dt-fission-m3-mvp , it doesn't seem Fission related at all.

Flags: needinfo?(odvarko)

I just tested again, made sure to have both fission & MBT disabled. STRs still apply, which means I don't think this is a Fission bug.

Did a bit of investigation, in the STRs reported here, the function that makes the event popup fail has no "script" attached.
It is onClickRow from:
https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/devtools/client/shared/components/tree/TreeView.js#459-479

What makes this method different from others is that it is bound twice.
Once in the constructor [1], and once when it is passed as a prop [2].
[1] https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/devtools/client/shared/components/tree/TreeView.js#234
[2] https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/devtools/client/shared/components/tree/TreeView.js#678

Suggested steps:

  • first of all make the code in react event-collector a bit safer (check if script is defined for instance)
  • stop the unnecessary double bind
  • investigate what it means to be missing the script property here

Not Fission related, removing related flags.

Fission Milestone: MVP → ---
Flags: needinfo?(odvarko)
Whiteboard: dt-fission-m3-mvp
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/24bc78c0fdc5
[devtools] Guard against missing handlerDO.script in React event-collector r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: