Open Bug 1519082 Opened 6 years ago Updated 3 years ago

Add API's on the Network Front to handle getting extra Network request info from the backend

Categories

(DevTools :: Netmonitor, enhancement, P3)

enhancement

Tracking

(Fission Milestone:Future)

Fission Milestone Future

People

(Reporter: yulia, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: dt-perf-stability-triage)

We currently use the webconsole client to manually route requests to netEvent actors. examples: https://searchfox.org/mozilla-central/source/devtools/shared/webconsole/client.js#462-640

We should instead use the netEvent front to take care of all of these requests automatically

Whiteboard: dt-fission
Priority: -- → P2
Depends on: 1528766
Blocks: 1528766
No longer depends on: 1528766

(In reply to Yulia Startsev [:yulia] from comment #0)

We currently use the webconsole client to manually route requests to netEvent actors. examples: https://searchfox.org/mozilla-central/source/devtools/shared/webconsole/client.js#462-640

We should instead use the netEvent front to take care of all of these requests automatically

Yulia that link isn't valid anymore. Can you please send a new perma link, please?

Honza

Flags: needinfo?(ystartsev)

yes, sorry about that. here is an updated link of methods in the webconsole that are used to send netevent requests: https://searchfox.org/mozilla-central/rev/597a69c70a5cce6f42f159eb54ad1ef6745f5432/devtools/shared/fronts/webconsole.js#250-428

There is a patch for this: https://phabricator.services.mozilla.com/D14395

Flags: needinfo?(ystartsev)

Even if the console panel is impacted, I consider this rather as specific to the netmonitor.

No longer blocks: dt-fission-browser-console
Component: Console → Netmonitor

Let's move it as P3 then, as netmonitor is not in M1 scope

Priority: P2 → P3
Whiteboard: dt-fission → dt-fission-reserve

Tracking Fission DevTools bugs for Fission Nightly (M6)

Fission Milestone: --- → M6

Clearing Fission Milestone because this is not a Fission bug.

Fission Milestone: M6 → ---
Whiteboard: dt-fission-reserve → dt-fission-reserve [fission-]

See also Bug 1659082 for some details

Adding followup notes from a patch
We should consider doing two things here:

Stop using the WebConsoleFront. We were not calling the WebConsoleActor's methods here.

There is all these functions on WebConsoleFront which relate to networking:
https://searchfox.org/mozilla-central/rev/e0eb861a187f0bb6d994228f2e0e49b2c9ee455e/devtools/client/fronts/webconsole.js#232-410
But they should rather be moved to the NetworkContentFront, here
https://searchfox.org/mozilla-central/source/devtools/client/fronts/network-content.js

They are trying to call these methods:
https://searchfox.org/mozilla-central/rev/e0eb861a187f0bb6d994228f2e0e49b2c9ee455e/devtools/server/actors/network-monitor/network-event-actor.js#152-278

More details from Alex
Stop using DevToolsClient.request in favor of protocol.js fronts
The code in WebConsoleFront is using conn.request(), this is very cryptic and deprecated. We should avoid using that. We actually would like to get rid of this request method. It keeps a lot of code alive in DevToolsClient just for this.
But using protocol.js means instantiating fronts, so that we would probably have to instantiate NetworkEventFront in a transformer, similarly to what Belèn is about to introduce here:
https://phabricator.services.mozilla.com/D92634#change-ddgzuOh7Fta9

Whiteboard: dt-fission-reserve [fission-] → dt-fission-m3-mvp

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

Fission Milestone: --- → MVP

Let me try to rephrase comment 10 in a more structure message.

This bug is about the requests to pull extra information about a given request. (headers, cookies, ... for requests and responses)

Today, these requests are done via the WebConsoleFront:
https://searchfox.org/mozilla-central/rev/07342ce09126c513540c1c343476e026cfa907bf/devtools/client/fronts/webconsole.js#232-410
And related actor implementation:
https://searchfox.org/mozilla-central/rev/07342ce09126c513540c1c343476e026cfa907bf/devtools/server/actors/network-monitor/network-event-actor.js#145-260

There is two issues about that here:

  1. This has nothing to do with the console, nor the console actor. This code should be moved to components related to network events or network monitor.
  2. We are using DebuggerClient.request. This is the only one place left where we use that. It bypass protocol.js and use a very old codepath to send and receive requests, which predates protocol.js It would be nice to remove this last usage and cleanup DebuggerClient quite significantly.

Having said that, there is many ways to address these two points.
To address 2), we have to start using a protocol.js front/actor.
To address 1), we have to use another placeholder, some front.

Comment 10 mentions reusing NetworkContentFront, that's an option. But we should acknowledge that it would be slightly special. Special in a good way.
We will have the NetworkContentActor to receive RDP requests (getRequestHeaders, getResponseHeader, ...) about many NetworkEventActors (many observed http requests). This will make NetworkEventActor no longer be an actor, but just some class used on the server, no longer directly exposed to the frontend.
Special in a good way as this pattern is actually what I have in mind with "Commands":
https://phabricator.services.mozilla.com/D97575
"Commands" are singleton actors, which receives methods calls, and some method calls may be about instances of resources.
Instead of following protocol.js principle, and having each resource be an actor and front, with methods.
These methods will be on the "command actor", and receive the resource ID.

Moving some dt-fission-m3-mvp bugs from Fission MVP to M7 (blocking Beta experiment).

Fission Milestone: MVP → M7

Tracking dt-fission-m3-mvp test and infrastructure bugs for Fission M8 (blocking Release experiment).

Fission Milestone: M7 → M8
Summary: Use netEvent front for netEvent requests rather than routing through the webconsole → Add API's on the Network Front to handle getting extra Network request info from the backend
Severity: normal → S3
Whiteboard: dt-fission-m3-mvp → dt-fission-m3-mvp, dt-fission-m3-triage
Whiteboard: dt-fission-m3-mvp, dt-fission-m3-triage → dt-fission-m3-triage
Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp

Tracking DevTools Post-M8 bugs for Fission MVP milestone. They don't block the Fission Release channel experiment, but we would like them to be completed before we roll out Fission by default.

Fission Milestone: M8 → MVP
Fission Milestone: MVP → Future
Whiteboard: dt-fission-m3-mvp → dt-fission-m4-mvp
Whiteboard: dt-fission-m4-mvp → dt-fission-m4-mvp, dt-perf-stability-triage

As said in last comments, but just to clarify what should be done here:
We should introduce a NetworkEvent command (or similar) in order to hide the call to DevToolsClient.request(...) and/or call the right Front.
So that all the frontent can call the NetworkEvent command with a trivial API and ignore all the complexity of RDP.

Whiteboard: dt-fission-m4-mvp, dt-perf-stability-triage → dt-perf-stability-triage
You need to log in before you can comment on or make changes to this bug.