Closed Bug 1811806 Opened 3 years ago Closed 3 years ago

Can't reopen the browser toolbox when closing it too quickly after opening

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox111 fixed)

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(2 files)

STR:

  • open browser console in multiprocess mode
  • close it immediately (do not wait for its initiailization)
    You should see the following exception:
JavaScript error: resource://devtools/client/webconsole/webconsole-ui.js, line 137: TypeError: can't access property "dispatch", this.wrapper.getStore() is null

Then trying to reopen it no longer work and there is no exception.

That's because the following this._browserConsoleInitializing is never cleared in case of exception during initialization:
https://searchfox.org/mozilla-central/rev/270f0ed2146821e239232728adac41a3de41131b/devtools/client/webconsole/browser-console-manager.js#88-97

Closing during its initialization (easy to reproduce with the multiprocess mode)
ends up disallowing any further reopening of the browser console.
You would have to restart firefox to make it work again.

This was related to _browserConsoleInitializing never been cleared.

There was another one highlighted by the test related to waitAsyncDispatches.
As the wrapper module is loaded via the browser loader,
it uses the document's setTimeout method which is disabled when the console closes
and its document is destroyed. This ended up creating a never resolving promise...

Do not try to run the test on verify as it is quite intensive already.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P2
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3d23eb63edd3 [devtools] Fix Browser Console issues when closing it during its initialization. r=devtools-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Regressions: 1812593
Flags: qe-verify+
Attached image 1811806.gif

Reproduced the issue with Firefox 111.0a1 (2023-01-23) on Windows 10x64. The browser console can no longer be opened if the browser console on Multiprocess is closed before initialization.

However, I can still sometimes reproduce the issue if the browser console is closed really really fast... I attached a screen recording. The issue is intermittent and hard to reproduce, should we file another issue for that and close this one? Thank you!

The verification was performed on Windows 10x64, macOS 12 and Ubuntu 20.04 with Firefox 111.0b8.

Flags: needinfo?(poirot.alex)

(In reply to Alexandru Trif, Desktop QA [:atrif] from comment #4)

However, I can still sometimes reproduce the issue if the browser console is closed really really fast... I attached a screen recording. The issue is intermittent and hard to reproduce, should we file another issue for that and close this one? Thank you!

Sorry for the delay getting back to this... thanks for catching this more subtle issue.

I do reproduce as well.
This seems to be related to a old legacy codepath that is about to be removed in bug 1651518.
I think this will go away as I land that other bug, which is planned to land soon.

Flags: needinfo?(poirot.alex)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: