Remote debugging fails on requests returning arrays
Categories
(DevTools :: Framework, defect, P3)
Tracking
(firefox85 fixed)
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: ochameau, Assigned: jdescottes)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files, 1 obsolete file)
The only visible breakage I've been able to reproduce is the blocked request sidebar in the netmonitor.
It triggers the WebConsoleActor.getBlockedUrls()
request, which is specified this way:
https://searchfox.org/mozilla-central/source/devtools/shared/specs/webconsole.js#249-252
getBlockedUrls: {
request: {},
response: RetVal("array:string"),
},
Nothing special on the actor, it just returns an array.
We do go through this code in protocol.js's Actor:
https://searchfox.org/mozilla-central/source/devtools/shared/protocol/Actor.js#194,205
response.from = this.actorID;
...
conn.send(response);
The different which explains why it works within firefox, but not with remote debugging is in the transport layer:
- Within Firefox, we use the LocalDebuggerTransport:
https://searchfox.org/mozilla-central/source/devtools/shared/transport/local-transport.js#43,53,68
send: function(packet) {
...
this._deepFreeze(packet);
...
other.hooks.onPacket(packet);
deepFreeze freeze the object, but doesn't do a JSON serialization.
- For remote debugging, we use DebuggerTransport:
https://searchfox.org/mozilla-central/source/devtools/shared/transport/transport.js#116-119
send: function(object) {
const packet = new JSONPacket(this);
packet.object = object;
which uses JSONPacket, doing a JSON serialization:
https://searchfox.org/mozilla-central/source/devtools/shared/transport/packets.js#152
set: function(object) {
this._object = object;
const data = JSON.stringify(object);
And this is where we loose the overloaded from
attribute.
This sounds tricky to fix without changing the spec to move the RetVal("array:string")
into a sub attribute in the response packet. So that we stop messing with the protocol base JSON object.
Reporter | ||
Comment 1•4 years ago
|
||
Here is the list of requests which probably fail on remote debugging:
https://searchfox.org/mozilla-central/search?q=response%3A+RetVal%28%22array%3A&path=&case=true®exp=false
Assignee | ||
Comment 2•4 years ago
|
||
We could also fix this in the transport layer. Maybe we should force all requests to wrap their response in an object?
Assignee | ||
Comment 3•4 years ago
|
||
Fixes the request blocking UI in remote debugging.
Updated•4 years ago
|
Comment 4•4 years ago
|
||
The severity field is not set for this bug.
:ochameau, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D96939
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D96940
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a423cb25ee61
https://hg.mozilla.org/mozilla-central/rev/acd7500696d6
Description
•