Closed Bug 1836856 Opened 9 months ago Closed 8 months ago

Add documentation about watcher architecture

Categories

(DevTools :: Shared Components, enhancement, P2)

enhancement

Tracking

(firefox116 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: fabrice, Assigned: ochameau)

Details

Attachments

(3 files)

The context of this bug is the revival of Servo's devtools support (see https://github.com/servo/servo/issues/29831).

Servo doesn't advertise watcher support, so when we enter the devtools toolbox for a tab, the init sequence never completes:

My understanding is that _resolveOnFirstTarget relies on switchToTarget() to be called and that never happens in our case (that seems hooked up to local remoteness change).

If the analysis above is correct, what is the best path forward? If it's actually mandatory to implement a frame watcher, I would suggest to at least add some error reporting and early return in startListening().

Here's the reply to the getTab(n) Servo is sending:

DBG-SERVER: Got: {
  "from": "root",
  "tab": {
    "actor": "tabDescription13",
    "title": "Example Domain",
    "url": "http://example.com/",
    "outerWindowID": 1,
    "browsingContextId": 1,
    "browserId": 1,
    "selected": true,
    "isZombieTab": false,
    "traits": {
      "watcher": false,
      "supportsReloadDescriptor": false
    }
  }
}
Type: enhancement → defect
Whiteboard: [devtools-triage]

Alex, you offered to add some documentation about watcher which could help Servo and others implement devtools support.
As discussed we could also add a test which does raw RDP so that we can check it still works and easily shared working code with others.

Type: defect → enhancement
Flags: needinfo?(poirot.alex)
Priority: -- → P2
Summary: Remote debugging of tabs with no frame watcher does not start → Add documentation about watcher architecture
Whiteboard: [devtools-triage]

This is no longer used. The returned promise should be used instead.

There was also some old lefovers in WebConsole Front related to network events.
As we no longer have legacy listeners, this is no longer used.
The frontend code now uses DevToolsClient.request directly to query the NetworkEventActor's.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

Try to document navigating throught the Root, Watcher, Target and Console actors
to listen for console messages and evalute some JS code.

This is a long overdue update to better describe the key actors:
root, descriptor, watcher, target and target-scope actors.

Flags: needinfo?(poirot.alex)
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6850948b14c0
[devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy
https://hg.mozilla.org/integration/autoland/rev/0fe632ebb487
[devtools] Document basic usages of RDP via a simple mochitest. r=devtools-reviewers,bomsy
https://hg.mozilla.org/integration/autoland/rev/636272515c00
[devtools] Update actors documentation. r=devtools-reviewers,bomsy
Flags: needinfo?(poirot.alex)
Flags: needinfo?(poirot.alex)
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fac27ddff8d5
[devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy
https://hg.mozilla.org/integration/autoland/rev/aceb5aaeb650
[devtools] Document basic usages of RDP via a simple mochitest. r=devtools-reviewers,bomsy
https://hg.mozilla.org/integration/autoland/rev/9bdc41648c38
[devtools] Update actors documentation. r=devtools-reviewers,bomsy
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.