Closed Bug 1712737 Opened 4 years ago Closed 4 years ago

Messages and errors from previous window globals may be notified twice

Categories

(DevTools :: Console, defect)

defect

Tracking

(Fission Milestone:M8, firefox91 fixed)

RESOLVED FIXED
91 Branch
Fission Milestone M8
Tracking Status
firefox91 --- fixed

People

(Reporter: ochameau, Assigned: nchevobbe)

References

Details

(Whiteboard: dt-fission-m3-mvp)

Attachments

(1 file, 1 obsolete file)

When enabling server side target switching (devtools.target-switching.server.enabled = true), we do create one target actor per WindowGlobal.
By doing so, we end up creating resource watchers for each WindowGlobal.

These console watchers will fetch errors and messages from platform cache:
https://searchfox.org/mozilla-central/source/devtools/server/actors/resources/utils/nsi-console-listener-watcher.js#55,62
This cache contains all errors and messages coming from any document running in the current process. So that it will typically contain messages from the previous WindowGlobal...
And as the code filtering out the messages currently filter out by browserId:
https://searchfox.org/mozilla-central/source/devtools/server/actors/resources/error-messages.js#84
We end up notifying about the previous WindowGlobal messages twice.
If persist is ON we will notify about all previous document messages twice,
if persist if OFF, we will see previous document messages in addition to the new document ones.

devtools/client/framework/test/browser_toolbox_error_count_reset_on_navigation.js is failing with devtools.target-switching.server.enabled = true because of that.

Fission Milestone: --- → M8
Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Attachment #9223353 - Attachment is obsolete: true
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e11836c2c03d [devtools] Filter nsiConsole messages by their innerWindowID. r=ochameau.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: