Closed Bug 1627977 Opened 5 years ago Closed 5 years ago

Use the ResourceWatcher API to fetch ConsoleService LogMessages

Categories

(DevTools :: Console, task, P1)

task

Tracking

(Fission Milestone:M6, firefox77 fixed)

RESOLVED FIXED
Firefox 77
Fission Milestone M6
Tracking Status
firefox77 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(2 files)

Bug 1576624 introduced the ResourceWatcher API, accessible via toolbox.resourceWatcher. This API will help listen to data that is being created early, when the document just started loading.

We should migrate the whole DevTools codebase to this API for any data that:

  • DevTools frontend listen to, or care about,
    and,
  • may be created or be notified early, when the document just starts being loaded.
    This data will typically be: console messages, errors, warnings, sources, Root element NodeFront, storage values, network events, stylesheets, ...

We are typically not going to use this API for:

  • data being fetched on-demand, from user's input. For ex: webconsole evaluation input, or, DOM element expands from the Markup view.
  • events which we only want to record when the user cares about them. For ex: animation events.

For some more high level context, please have a look at Migration to Fission-compatible APIs, which describes all Fission-related refactorings.

The typical task for this bug will be about migrating code that:

  • start listening and register a RDP event listener,
  • retrieve already existings data,
    from panel's codebase, to the ResourceWatcher module, in the LegacyListener object.
    And then, the panel should use the ResourceWatcher instead.

Bug 1620234 is a good example of such migration, applied to Console Messages.
Bug 1623699 is also useful example as it demonstrates how to write tests for such migration.

This bug is about focusing on only one usecase in the console: the LogMessage.
LogMessage are emitted through the ConsoleService message (https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/devtools/server/actors/webconsole.js#1588-1591), and the listeners is set by the console client (https://searchfox.org/mozilla-central/source/devtools/client/webconsole/webconsole-connection-proxy.js#142)

The only issue is that at the moment we don't have a dedicated way to fetch the cached logMessages. They're retrieved at the same time as the pageError cached messages.

We should probably try to clean this up, as this can impact the handling of pageError messages as well.

No longer blocks: 1625910
Depends on: 1627979

Tracking Fission DevTools bugs for Fission Nightly (M6) milestone

Fission Milestone: --- → M6
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08f530753916 Move legacyListeners to their own folder. r=ochameau. https://hg.mozilla.org/integration/autoland/rev/0b9746e48f91 Use the ResourceWatcher API to fetch ConsoleService LogMessages. r=ochameau.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: