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•4 years 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•4 years 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•4 years 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•4 years ago
|
||
Go to https://unclosed-console-group.glitch.me/ , open the console, and reload the page several times. It should reproduce.
Comment 5•4 years 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•4 years 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•4 years 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•4 years ago
|
||
Bug 1593933 - Navigating should close existing console.group
Comment 9•4 years ago
|
||
Kartikeya, are you still interested in fixing this bug? There is a review comment waiting for your action.
Honza
Comment 10•4 years ago
|
||
I apologize for the delay but currently I wont be able to work on this. :(
Reporter | ||
Comment 11•4 years ago
|
||
Thanks for the heads-up Kartikeya, I'll unassign the bug :)
Assignee | ||
Comment 12•4 years ago
|
||
I'd like to work on this!
Reporter | ||
Comment 13•4 years ago
|
||
Thanks Miguel, it's now yours :)
Assignee | ||
Comment 14•4 years ago
|
||
change state property currentGroup
Updated•4 years ago
|
Comment 15•4 years 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•4 years ago
|
||
bugherder |
Description
•