Open Bug 1642297 Opened 5 years ago Updated 5 months ago

Merge or cleanup ConsoleAPIListener into devtools/server/actors/resources/console-messages.js

Categories

(DevTools :: Console, task, P3)

task

Tracking

(Fission Milestone:Future)

Fission Milestone Future

People

(Reporter: ochameau, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: dt-fission-future)

Bug 1620243 introduce a new codepath for listening to console message.
We now listen for console messages via devtools/server/actors/resources/console-messages.js module, instead of the WebConsoleActor.
This new module reused ConsoleAPIListener as-is:
https://searchfox.org/mozilla-central/source/devtools/server/actors/webconsole/listeners/console-api.js
But we could probably:

  • merge it into this new module,
  • and/or, at least tweak a few things in order to remove legacy code and better align to the ResourceWatcher/WatcherActor APIs.

Note that if we don't merge the two files, we may better wait for bug 1642296.
Otherwise we would still have the WebConsoleActor using this module and may require some unecessary maintenance of it.

In term of legacy and merge opportunities, we can probably:

  • Stop passing an owner object and pass a function. Or merge ConsoleAPIListener into console-messages.js?
  • Merge filtering around service workers currently done from the console-messages.js module into the ConsoleAPIListener function?
  • Review ConsoleAPIListener.getCachedMessage as it may create unecessary copies of list of messages when using functional style array methods.
  • Review prepareConsoleMessageForRemote and all its delete this.xxxxxxx calls. This may be pure legacy.
  • Review the call to target.attach(). We do that in order to ensure that the threadActor is instantiated. This is being used via prepareConsoleMessageForRemote > TabSources.getActorIdForInternalSourceId. We should ensure that having a thread actor is a real requirement. If it is, may be try to only instantiate it instead of attaching the target. About that, we should probably coordinate with bug 1641121.

Tracking dt-fission-m2-reserve bugs for Fission Beta milestone (M7).

Fission Milestone: --- → M7
See Also: → 1641121
Depends on: 1644966

Bulk move of all dt-fission-m2-reserve bugs to Fission MVP milestone.

Fission Milestone: M7 → MVP
Whiteboard: dt-fission-m2-reserve → dt-fission-m3-reserve

Moving "dt-fission-m3-reserve" bugs to "dt-fission-future" because they don't block Fission MVP.

Fission Milestone: MVP → Future
Whiteboard: dt-fission-m3-reserve → dt-fission-future
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.