Update messages shown according to the currently enabled logpoints
Categories
(Core Graveyard :: Web Replay, enhancement)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: bhackett1024, Assigned: bhackett1024)
References
(Blocks 1 open bug)
Details
Attachments
(5 files, 1 obsolete file)
29.60 KB,
patch
|
Details | Diff | Splinter Review | |
4.58 KB,
patch
|
loganfsmyth
:
review+
|
Details | Diff | Splinter Review |
3.12 KB,
patch
|
loganfsmyth
:
review+
|
Details | Diff | Splinter Review |
16.22 KB,
patch
|
Details | Diff | Splinter Review | |
8.20 KB,
patch
|
nchevobbe
:
superreview+
|
Details | Diff | Splinter Review |
When a logpoint is added while replaying, it applies retroactively throughout the recording. This is kind of problematic when logpoints are being edited or frequently added and removed, as the console will become populated with lots of old irrelevant messages.
It would be better if the logpoint messages shown in the console reflected those which are currently installed. The attached patch makes this change, and a couple others:
-
Adds support for conditional logpoints when replaying.
-
Adds tests for the new and existing logpoint functionality.
Assignee | ||
Comment 1•6 years ago
|
||
The debugger client removes old logpoints by first generating a uniqueish ID (via Math.random) every time it sets a logpoint in a replaying process. These IDs are associated with each message sent to the console for that logpoint, and when the logpoint is removed by the client it sends an event to the console to remove all messages associated with that ID.
Note that right now this functionality only works with web replay. I think we'll want to do something like this for normal logpoints at some point, but figuring out the right semantics is a little trickier, see https://github.com/firefox-devtools/debugger/issues/7816
Assignee | ||
Comment 2•6 years ago
|
||
Keep track of the optional logpoint ID in console messages, and add a MESSAGES_CLEAR_LOGPOINT redux action which the debugger invokes to remove all console messages with a given logpoint ID.
Assignee | ||
Comment 3•6 years ago
|
||
This is largely an independent change (part 1 had to touch the calling code so I thought we might as well fix this now), but this patch changes the ReplayDebuggerScript.replayVirtualConsoleLog interface to support conditional logpoints (which we already support in the normal forward-execution case).
Assignee | ||
Comment 4•6 years ago
|
||
Add a couple new tests for logpoint functionality when replaying. This also removes the boilerplate in the test files describing how to disable the web replay tests, which isn't relevant now that the tests are tier 2.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
(In reply to Nicolas Chevobbe from comment #5)
Comment on attachment 9046176 [details] [diff] [review]
Part 2 - Allow clearing console messages by their logpoint ID.Review of attachment 9046176 [details] [diff] [review]:
Hello Brian, thanks for the patch. I'm really sorry about the long delay :/
So, I have a couple of nits and one question about the structure to store
the removed logPoints.
Also, I think we should release actors when removing the logPoints. You can
see how we do it in
[devtools/client/webconsole/enhancers/actor-releaser.js#19-29](https://
searchfox.org/mozilla-central/rev/92d11a33250a8e368c8ca3e962e15ca67117f765/
devtools/client/webconsole/enhancers/actor-releaser.js#19-29).
state.messages.removedActors
is populated inremoveMessagesFromState
,
which you use, so what's left to do is add check the clear log point action
in actor-releaser.js .Out of curiosity, when does
clearLogpointMessages
is emitted?
Calls to emit are in part 1. When the debugger client removes or changes a breakpoint with a logpoint value in the server then it will (if we are replaying) emit clearLogpointMessages to remove messages associated with the old logpoint value.
Assignee | ||
Comment 7•6 years ago
|
||
(In reply to Nicolas Chevobbe from comment #5)
::: devtools/client/webconsole/reducers/messages.js
@@ +58,5 @@// Map of the form {messageId : networkInformation}
//networkInformation
holds request, response, totalTime, ...
networkMessagesUpdateById: {},
- // Set of logpoint IDs that have been removed
- removedLogpointIds: {},
nit: could it be
removedLogPointIds
?
Hmm, is it OK to keep the current capitalization? The nomenclature we've been using for this feature so far has treated 'logpoint' as a single word, as with 'breakpoint', e.g. see the title of bug 1526554. It would be nice to handle this consistently in the devtools to avoid confusion / typos.
Assignee | ||
Comment 8•6 years ago
|
||
Updated patch per comments (though see comment 7).
Comment 9•6 years ago
|
||
Hmm, is it OK to keep the current capitalization? The nomenclature we've been using for this feature so far has treated 'logpoint' as a single word, as with 'breakpoint', e.g. see the title of bug 1526554. It would be nice to handle this consistently in the devtools to avoid confusion / typos.
yeah sure. Now that you talk about breakpoint, I agree to keep that consistent.
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b0310f8849e0
https://hg.mozilla.org/mozilla-central/rev/1e997aba85bb
https://hg.mozilla.org/mozilla-central/rev/0385531495c5
https://hg.mozilla.org/mozilla-central/rev/033697893400
https://hg.mozilla.org/mozilla-central/rev/8cccd561de71
Updated•5 years ago
|
Description
•