Closed Bug 1639165 Opened 5 years ago Closed 5 years ago

Errors from content page are logged twice in the Multiprocess Browser Toolbox

Categories

(DevTools :: Console, defect, P1)

defect

Tracking

(Fission Milestone:M6c, firefox79 fixed)

RESOLVED FIXED
Firefox 79
Fission Milestone M6c
Tracking Status
firefox79 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(2 files)

Steps to reproduce

  1. Go to https://nchevobbe.github.io/demo/console-test-app.html
  2. Open the multiprocess browser toolbox
  3. In the content page, click on the "Exception" button

Expected results

An error is displayed in the browser toolbox

Actual results

2 errors are displayed in the browser toolbox.


After some investigation, I was able to see that those messages are coming from different targets.
The first one is from the content process target, and the second one from the parent process one.

I think the second message is coming from xpcom/base/nsConsoleService.cpp#162, where nsIScriptError from the content processes are forwarded to the parent process.

We should return early in MaybeForwardScriptError if devtools.browsertoolbox.fission is set to true.

Assignee: nobody → nchevobbe
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P1

Tracking dt-fission-m2-mvp bugs for Fission Nightly milestone (M6c)

Fission Milestone: --- → M6c

What's said in comment 0 isn't relevant. The duplication happens because we also log from dom/ipc/ContentChild.cpp#455-538.

Attachment #9151656 - Attachment description: Bug 1639165 - Don't log message from ContentChild when multiprocess browser toolbox is enabled. r=evilpie. → Bug 1639165 - Don't log message from ContentChild when multiprocess browser toolbox is enabled. r=baku.
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/14084268455c Don't log message from ContentChild when multiprocess browser toolbox is enabled. r=baku.

ah, this wasn't caught by my TRY push, I'll investigate

Flags: needinfo?(nchevobbe)
Attachment #9151656 - Attachment description: Bug 1639165 - Don't log message from ContentChild when multiprocess browser toolbox is enabled. r=baku. → Bug 1639165 - Add an isFowardedFromContentProcess flag to nsIScriptError. r=baku.

We were getting duplicated nsIScriptError in the Browser Toolbox console and the Browser Console
when the multiprocess pref is enabled, because error from content processes are forwarded to
the main process.
The previous patch of this queue added a isForwardedFromContentProcess flag to nsIScriptError,
that we use in this patch to not handle forwarded messages in multiprocess browser console
and browser toolbox console.

Depends on D76792

Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c5cd10328f91 Add an isFowardedFromContentProcess flag to nsIScriptError. r=baku. https://hg.mozilla.org/integration/autoland/rev/6c7cd0394f8d Don't log messages forwarded from content processes when multiprocess browser toolbox is enabled. r=Honza.
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fd256d1ad341 Add an isFowardedFromContentProcess flag to nsIScriptError. r=baku. https://hg.mozilla.org/integration/autoland/rev/ad832014f2d2 Don't log messages forwarded from content processes when multiprocess browser toolbox is enabled. r=Honza.

fixed the failing tests

Flags: needinfo?(nchevobbe)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: