Navigating should close existing console.group
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox83 fixed)
| Tracking | Status | |
|---|---|---|
| firefox83 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: mroncancio19)
References
Details
Attachments
(4 files)
Steps to reproduce
- Navigate to
data:text/html,<script>console.group("hello")</script> - Open the console
- Ensure the "Persist Logs" setting is ON
- Reload the tab several time
Actual results
The existing groups never close, which looks quite weird:
┌────────────────────────────────────────┐
│ ▼ hello │
├──┬─────────────────────────────────────┤
│ │ Navigated to data:text/html │
├──┼─────────────────────────────────────┤
│ │ ▼ hello │
├──┴──┬──────────────────────────────────┤
│ │ Navigated to data:text/html │
├─────┼──────────────────────────────────┤
│ │▼ hello │
└─────┴──────────────────────────────────┘
Comment 1•1 year ago
|
||
Hey I just tried replicating this error in the latest pull of the mozilla-central and wasn't able to replicate this issue. The logs groups didn't persist
| Reporter | ||
Comment 2•1 year ago
|
||
Yes, it looks like bugzilla encoded some chars in Comment 0.
You can reproduce by evaluating console.group("hello"); document.location.reload(); a few time, having the "persist logs" option ON.
Let me know if you can reproduce.
I also assigned you the bug :)
Comment 3•1 year ago
|
||
Hey I tried recreating that bug however wasn't able to do it.
I've attached the screenshot. Am I doing something wrong?
| Reporter | ||
Comment 4•1 year ago
|
||
Go to https://unclosed-console-group.glitch.me/ , open the console, and reload the page several times. It should reproduce.
Comment 5•1 year ago
|
||
Yeah it is showing now.
Could you please guide me more regarding where I would be able to fix this? and what all tests should be added/changed?
Thanks
| Reporter | ||
Comment 6•1 year ago
|
||
So this is the piece of state that holds the current group: devtools/client/webconsole/reducers/messages.js#100-101
This needs to be set to null when the "Navigated to" message is added. The message is added from devtools/client/webconsole/webconsole-wrapper.js#257-258 , in the end, this will cause this redux action to be dispatched devtools/client/webconsole/actions/messages.js#50-53 .
This action is then handled in the messages reducer devtools/client/webconsole/reducers/messages.js#393
What we need to do is to check the type, and if it matches the navigation message type, set the currentGroup property to null.
Comment 7•1 year ago
|
||
When persist log is on and the page is reloaded, if the console.group command is used, the newer logs keep on getting appended to the older ones.
Solved this by looking for the navigation marker message and when intercepted, sent a synthetic endGroup message to close the current group.
Comment 8•1 year ago
|
||
Bug 1593933 - Navigating should close existing console.group
Kartikeya, are you still interested in fixing this bug? There is a review comment waiting for your action.
Honza
Comment 10•1 year ago
|
||
I apologize for the delay but currently I wont be able to work on this. :(
| Reporter | ||
Comment 11•1 year ago
|
||
Thanks for the heads-up Kartikeya, I'll unassign the bug :)
| Assignee | ||
Comment 12•8 months ago
|
||
I'd like to work on this!
| Reporter | ||
Comment 13•8 months ago
|
||
Thanks Miguel, it's now yours :)
| Assignee | ||
Comment 14•8 months ago
|
||
change state property currentGroup
Updated•8 months ago
|
Comment 15•8 months ago
|
||
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cdf395992b18 [devtools] Navigating should close existing console.group messages. r=nchevobbe
Comment 16•8 months ago
|
||
| bugherder | ||
Description
•