Closed Bug 1525624 Opened 6 years ago Closed 2 years ago

Group CSP warning messages in the console

Categories

(DevTools :: Console, enhancement, P2)

enhancement

Tracking

(firefox110 fixed)

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: nchevobbe, Assigned: tschuster)

References

(Blocks 4 open bugs)

Details

Attachments

(1 file)

No description provided.
Whiteboard: [console-unclutter]
Blocks: 1376953
Whiteboard: [console-unclutter] → [console-grouping]
Whiteboard: [console-grouping]
See Also: → 1639096
Severity: normal → S3
Assignee: nobody → tschuster
Attachment #9306657 - Attachment description: WIP: Bug 1525624 - Group CSP warning messages in the console → Bug 1525624 - Group CSP warning messages in the console. r?nchevobbe
Status: NEW → ASSIGNED
Pushed by tschuster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7cacd26eab2e Group CSP warning messages in the console. r=nchevobbe
Flags: needinfo?(tschuster)

I am still having issues with duplicate messages appearing in the Web Console, I first thought this was related to bug 1645745 but it's not. From my logging it seems like we only call CSP_LogMessage once, but the same message appears twice in the web console. I wonder if it has something to do how the test first opens a data: URI and then redirects to some http page: . I can reproduce this duplication reliably locally.

Flags: needinfo?(nchevobbe)

(In reply to Tom Schuster (MoCo) from comment #4)

I wonder if it has something to do how the test first opens a data: URI and then redirects to some http page: . I can reproduce this duplication reliably locally.

I can't reproduce locally (even with --verify).
I added some logs and pushed to TRY (without any failure so far) : https://treeherder.mozilla.org/jobs?repo=try&revision=d404b153090606659d90facd8ce744eb1874cac2
How are you running the test to reproduce ? (or maybe you're reproducing with another STR ?)

That being said, In the logs where it fails, we can see 2 separate messages https://treeherder.mozilla.org/logviewer?job_id=399381597&repo=autoland&lineNumber=3419-3420

These are coming directly from Services.console (https://searchfox.org/mozilla-central/rev/abf6758ed833c203f84703aa2e3e3d317571b1e9/testing/mochitest/browser-test.js#328 https://searchfox.org/mozilla-central/rev/abf6758ed833c203f84703aa2e3e3d317571b1e9/testing/mochitest/browser-test.js#547-550,560) , so this is not an issue with the console client.
Maybe there's something wrong with the Service, but I can't remember anything similar

Flags: needinfo?(nchevobbe)

Thanks Nicolas for investigating. I just did a new try push and now I also get a failure on try with browser_webconsole_csp_ignore_reflected_xss_message.js.

The failure is again related to unexpected duplicated messages that lead to grouping. I can also reproduce the failure on browser_webconsole_navigate_to_parse_error.js after a few tries locally. I think what happens is that sometimes we find the expected message before we get the second message and start a group. So this is timing dependent - Do we find the single message before the second message arrives and we have a group.

Maybe there's something wrong with the Service, but I can't remember anything similar

Yeah. I don't really know either.

What does seem to strange to me is that I only see a single

0:05.75 INFO Console message: [JavaScript Warning: "Content Security Policy: Not supporting directive ‘reflected-xss’. Directive and values will be ignored." {file: "http://example.com/browser/devtools/client/webconsole/test/browser/test_console_csp_ignore_reflected_xss_message.html" line: 0}]

in the log, but there are clearly two messages in the web console. That does make me suspect something is wrong with the console itself.

Depends on: 1808912
Pushed by tschuster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fe14551c6ae9 Group CSP warning messages in the console. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Depends on: 1809601
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: