Event breakpoints are not managed properly
Categories
(DevTools :: Debugger, defect)
Tracking
(firefox-esr91 unaffected, firefox95 wontfix, firefox96 wontfix, firefox97 verified, firefox98 verified)
| Tracking | Status | |
|---|---|---|
| firefox-esr91 | --- | unaffected |
| firefox95 | --- | wontfix |
| firefox96 | --- | wontfix |
| firefox97 | --- | verified |
| firefox98 | --- | verified |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
Steps to reproduce
- Navigate to
data:text/html,<meta charset=utf8><button>Click</button><script>document.querySelector("button").addEventListener("click", e => console.log(e))</script> - Open the debugger
- In the event listener breakpoint panel, check
click - Click on the button in the content page, the debugger should pause
- In the event listener breakpoint panel, uncheck
click - Click on the button in the content page again
Expected results
Nothing should happen
Actual results
The debugger pauses
I can reproduce in 94, but not in 91 ESR, I'll try to find a better regression range
| Assignee | ||
Comment 1•4 years ago
|
||
Running mozregression I got this range https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e7f3e1f5b6253d91b5eeb60ac23a35cb12bafa5a&tochange=4eda9eb8926bdd50f4b80128ce3475eb7c6d9a4d , in which we can see Bug 1717802 , which seems to be a good candidate for regression
The event breakpoints tests we have don't cover removing breakpoints which is why it went unnoticed
Updated•4 years ago
|
| Assignee | ||
Comment 2•4 years ago
•
|
||
In target-actor-mixin, addSessionDataEntry does have a if block for EVENT_BREAKPOINTS, but removeSessionDataEntry does not:
https://searchfox.org/mozilla-central/rev/fbf1e796ecead9484deced4d99f199f327ba25ab/devtools/server/actors/targets/target-actor-mixin.js#111,124,126,130,132
| Assignee | ||
Comment 3•4 years ago
|
||
Note that we're also not adding the event breakpoints properly
In https://searchfox.org/mozilla-central/rev/fbf1e796ecead9484deced4d99f199f327ba25ab/devtools/server/actors/targets/target-actor-mixin.js#119 , we're setting the active event breakpoints to be what is sent from the client, which is basically the last checked event in the debugger. So in the debugger event listener breakpoints panel if you:
- check the
clickcheckbox - and then check the
auxclickcheckbox
only the auxclick event listener bp will be enabled, not the click one
| Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Set release status flags based on info from the regressing bug 1717802
Updated•4 years ago
|
| Assignee | ||
Comment 5•4 years ago
|
||
In target-actor-mixin, we were calling setActiveEventBreakpoints only with the
new events we were receiving, which mean if the user was clicking a first event in
the UI, and then a second one, only the second one would have a functioning event breakpoint.
Also, we were not handling removing event breakpoints at all.
We're adding (add|remove)EventBreakpoints to the thread actor so it's easier
to update the list of event breakpoints.
The existing event breakpoints test is modified to ensure we don't regress such behaviour.
The call to setEventListenerBreakpoints is moved before dispatch the UPDATE_EVENT_LISTENERS
action so we can properly wait for the breakpoint to be set in tests.
Comment 7•4 years ago
|
||
| bugherder | ||
Comment 8•4 years ago
|
||
Is this something you wanted to nominate for Beta uplift?
Updated•4 years ago
|
| Assignee | ||
Comment 10•4 years ago
|
||
Comment on attachment 9257820 [details]
Bug 1748589 - [devtools] Fix event listener breakpoints toggling. r=bomsy.
Beta/Release Uplift Approval Request
- User impact if declined: In the DevTools debugger, event listener breakpoints won't work great:
- breakpoints can't be removed, meaning the user will get paused when they don't expect to
- only the last event breakpoint checked will be enabled, which will lead the debugger to not pause when the user expect to
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See STR from Comment 0
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): DevTools only change, with a mochitest
- String changes made/needed:
| Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Reproduced this issue using an affected Nightly build from 2022-01-04, following the STR from Comment 0, on macOS 10.14.
Verified fixed on 98.0a1 (20220111213255) across the following platforms: macOS 10.14, Windows 10 x64 and Ubuntu 20.04.
Comment 12•4 years ago
|
||
Comment on attachment 9257820 [details]
Bug 1748589 - [devtools] Fix event listener breakpoints toggling. r=bomsy.
Approved for 97.0b3. Thanks.
Comment 13•4 years ago
|
||
| bugherder uplift | ||
Comment 14•4 years ago
|
||
Verified fixed on 97.0b3 using a treeherder build (Build ID: 20220112193650) across the following platforms: macOS 10.14, Windows 10 x64 and Ubuntu 20.04.
Description
•