Use DOCUMENT_EVENT's will-navigate event to track navigation in Debugger
Categories
(DevTools :: Debugger, enhancement, P2)
Tracking
(Fission Milestone:M8, firefox91 fixed)
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(2 files)
Today, the debugger contains a hack to fake a willNavigate from onTargetAvailable in case of target-switching, as we may miss it when navigating to another process/origin:
https://searchfox.org/mozilla-central/source/devtools/client/debugger/src/client/firefox.js#103-108
But:
-
This isn't ideal, as will-navigate is supposed to fire a bit earlier, before the target even exists. It is probably better to use DOCUMENT_EVENT will-navigate so that we avoid any race. We especially shouldn't clear too late. Clearing on target-available should be fine. But just to be safe, doing it earlier would be extra safe!
-
The call to
actions.willNavigate
is redundant with the call toactions.connect
https://searchfox.org/mozilla-central/source/devtools/client/debugger/src/client/firefox.js#134-138
And on top of that,connect
is called after a couple of async operation, which is a significant source of troubles during target switching as we reset things too late, after some sources are being processed and after some breakpoint are being hit ://
=> We should do two things: migrate to DOCUMENT_EVENT and stop calling connect from target-available.
Assignee | ||
Comment 1•3 years ago
|
||
connect
and willNavigate
actions are redundant, except for the isWebExtension argument.
And calling connect
late, after a few async code make us reset redux state way too late.
Some sources/breakpoints could be processed before and we end up having confusing state.
Assignee | ||
Comment 2•3 years ago
|
||
Clearing debugger state from onTargetAvaible should be fine,
as soon as we do it immediately.
But doing it from DOCUMENT_EVENT will-navigate may help
if we get some debugger related resources while the target is still attaching on the client.
It should better ensure that state is cleared at the right time, the earliest right time.
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e47eca0c22e [devtools] Call Debugger `connect` action only once. r=nchevobbe,bomsy https://hg.mozilla.org/integration/autoland/rev/83a5ecde6f6f [devtools] Use DOCUMENT_EVENT will-navigate in debugger. r=nchevobbe,bomsy
Updated•3 years ago
|
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9e47eca0c22e
https://hg.mozilla.org/mozilla-central/rev/83a5ecde6f6f
Description
•