Closed Bug 1705697 Opened 5 years ago Closed 5 years ago

WebConsole can end up broken when navigating between pages that would create warning groups

Categories

(DevTools :: Console, defect, P2)

Firefox 87
defect

Tracking

(firefox89 fixed, firefox90 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
firefox89 --- fixed
firefox90 --- fixed

People

(Reporter: kernp25, Assigned: nchevobbe)

Details

Attachments

(4 files, 6 obsolete files)

Attached image firefox_N2hHSwaCPk.png (obsolete) —

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

  1. Install https://addons.mozilla.org/firefox/addon/docx-viewer/
  2. Open a new tab
  3. Make sure devtools.webconsole.persistlog is true
  4. Open the developer console (https://developer.mozilla.org/en-US/docs/Tools/Web_Console)
  5. Open https://calibre-ebook.com/downloads/demos/demo.docx

Actual results:

It will stop logging the Navigated to... in the console.

After some more browsing the console gets broken (see picture).

Expected results:

Should just work as expected.

The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Console
Product: Firefox → DevTools

The toolbar is removed in the attached picture.

Attached image firefox_JxgFba6UqQ.png

How it should look like.

Attached file demo.docx (obsolete) —

Update: You need to open this link to reproduce the bug.

Attachment #9216398 - Attachment is obsolete: true

Update 2: You need to open google and search for filetype:docx test.
Then click on any link that points to a docx file.

Attached video aCKO7Kgr4a.mp4

How to reproduce the bug.

Attached video SswzPiSXuN.mp4 (obsolete) —

In this video the toolbar will only be removed but the logging will continue working.

(In reply to kernp25 from comment #8)

Created attachment 9216416 [details]
SswzPiSXuN.mp4

In this video the toolbar will only be removed but the logging will continue working.

This happens also with devtools.webconsole.persistlog set to false.

Hello kernps25, thanks for the report.

Could you paste the content of the browser console here (https://developer.mozilla.org/en-US/docs/Tools/Browser_Console) ? that might help

(In reply to kernp25 from comment #8) > Created attachment 9216416 [details] > SswzPiSXuN.mp4 > > In this video the toolbar will only be removed but the logging will continue working. The browser console content: ``
Attached image firefox_qf8sI7UuAN.png (obsolete) —

For the toolbar removed only bug (this bug seems to happen, if the page is still loading and then navigated back).

Attached image firefox_ezw97W4StK.png (obsolete) —

The browser console content for the bug i reported first.

I was able to reproduce on 87 once, but I was able to get the new message once I did evaluated an expression in the console.
I wasn't able to reproduce on Firefox 89, and I know we did some changes around those areas.
Would you be able to check on Firefox Nightly if you still see the issue?

Attached image firefox_G2XmTT9sKB.png

On Firefox Nightly (89.0a1 (2021-04-16) (64-Bit)) it will show TypeError: can't access property "push", state.warningGroupsById.get(...) is undefined in the browser console.

STR for the stop logging bug:

  1. Open a new tab
  2. Make sure devtools.webconsole.persistlog is true
  3. Open the web console (https://developer.mozilla.org/en-US/docs/Tools/Web_Console)
  4. Open google and search for filetype:docx test
  5. Click on a link that points to a docx file

The bug with the toolbar being removed seems fixed in Firefox Nightly.

Flags: needinfo?(nchevobbe)
Severity: -- → S3
Priority: -- → P2

Looks like there's a race condition that can be triggered where a warning group message could be "repeated" with a warning message from a previous navigation, which would make the new one being ignored and causing issues further down the road.
I'll work on a proper patch and test for this on Monday (the issue is probably here since we introduced warning groups)

Flags: needinfo?(nchevobbe)
Summary: Developer console gets broken when redirect to a moz-extension:// url with devtools.webconsole.persistlog to true → WebConsole can end up broken when navigating between pages that would create warning groups
Assignee: nobody → nchevobbe
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

It could happen that 2 warning group messages could be added successively, before
the navigation message was emitted.
In the reducer, the second message would be seen the same as the first one, and
we'd try to increment the repeat count for the first one.
Unfortunately, the code was expecting a warning group to be created, and there
was an exception thrown as we couldn't retrieve it.
This is fixed by not allowing warning groups to be repeated.
A mocha test is added instead of a mochitest, as the issue would have been tricky
to trigger properly.

Attachment #9216424 - Attachment is obsolete: true
Attachment #9216431 - Attachment is obsolete: true
Attachment #9216433 - Attachment is obsolete: true
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e74900b7d41 [devtools] Warning group messages shouldn't be repeatable. r=bomsy.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

Comment on attachment 9218227 [details]
Bug 1705697 - [devtools] Warning group messages shouldn't be repeatable. r=bomsy.

Beta/Release Uplift Approval Request

  • User impact if declined: The WebConsole can end up in a broken state, not showing any messages that are emitted from the page, which could be very confusing for the user
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): the patch is a one line fix, where we change the "configuration" of a given type of message so it can't be "repeated" in the console UI
  • String changes made/needed:
Attachment #9218227 - Flags: approval-mozilla-beta?
Attachment #9216416 - Attachment is obsolete: true
Attachment #9216376 - Attachment is obsolete: true

Comment on attachment 9218227 [details]
Bug 1705697 - [devtools] Warning group messages shouldn't be repeatable. r=bomsy.

Low risk one liner with tests, approved for 89 beta 9, thanks.

Attachment #9218227 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: