Closed Bug 1617210 Opened 5 years ago Closed 5 years ago

Properties with same values can't be expanded in the scopes panel

Categories

(DevTools :: Debugger, defect, P1)

73 Branch
defect

Tracking

(firefox-esr68 unaffected, firefox73 wontfix, firefox74 verified, firefox75 verified)

VERIFIED FIXED
Firefox 75
Tracking Status
firefox-esr68 --- unaffected
firefox73 --- wontfix
firefox74 --- verified
firefox75 --- verified

People

(Reporter: soeren.hentzschel, Assigned: nchevobbe)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached image screencast

Posting this on behalf of another user in a Firefox support forum.

When using the debugger in the browser toolbox you can't expand the "target" property in the right sidebar. I don't know if other properties are also affected and if it's also an issue with the web debugger but I got the attached screencast which shows the issue better than I am able to explain it (I've never used the debugger).

According to mozregression it's a regression from bug 1567849.

Flags: needinfo?(nchevobbe)

Hello Sören, thanks for reporting the issue. The regression looks odd since the bug only modified methods used by the console client.
It looks like you're testing the Browser Toolbox? Could you tell me in which file, and which line you put the breakpoint? Thanks!

Flags: needinfo?(nchevobbe) → needinfo?(soeren.hentzschel)

I'm able to reproduce with data:text/html,<meta charset=utf8><script>document.addEventListener("click", function(e) {debugger;})</script>

The user in the support forum gave me chrome:// -> content -> elements > arrowscrollbox.js line 822 as an example but I can confirm that your example also reproduces the issue.

I don't know if other properties are also affected and if it's also an issue with the web debugger

Thanks to your example I can answer these questions: Other (but not all) properties are also affected and it also happens with the web debugger, not only the browser toolbox. I changed the bug title to reflect that not only the "target" property is affected.

Flags: needinfo?(soeren.hentzschel)
Summary: target property in right sidebar of debugger can no longer be expanded → some properties in right sidebar of debugger can no longer be expanded

using mozregression the pushlog can't get smaller than https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3c08edf74d039af79f9daad8ff5b57ffb64fdab6&tochange=32f84899fc000d95337a25c14a27470d0c52e3ee

My guess would be more Bug 1579090 , we need to investigate what's going on in the scopes panel.

Priority: -- → P1

okay I managed to have a simpler STR:

  1. Navigate to data:text/html,<script>var hello = {hello: "world"}; x = {a: hello, b: hello}; debugger;</script>
  2. Open the debugger
  3. Reload so we hit the debugger statement
  4. Expand window and then x, and then try to expand a

Actual result: a can't be expanded.
The reason is that we create 2 fronts for the properties of x, one for a, one for b.
But they refer to the same actor which confuses protocol.js. Basically, when we call enumProperties on Front "A", that's Front "B" that will try to handle the response. And since the request didn't initially came from "B", we don't have the callback we should execute.

This only impacts the debugger because in the thread actor we're caching the object actors (devtools/server/actors/thread.js#1576-1578). In the console we get 2 different actors for a and b, so we don't hit this issue.

I'm tempted to remove the cache mechanism has a hotfix that could be uplifted all the way to release, and then think about a proper fix (that mayb be: don't cache those actors).

I have a much better and simpler approach, will post a patch as soon as I have a test written.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Summary: some properties in right sidebar of debugger can no longer be expanded → Properties with same values can't be expanded in the scopes panel

Since the thread actor caches the object actors
it creates, if an object had multiple properties
referencing the same object, we would create
multiple fronts for the same object actor, which
would confuse protocol.js.
The fix consist in checking if a front already exists
before creating a new one.
A test is added for the debugger to ensure this
works as expected and we don't regress.

Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/336f88eaf4e2 Fix issue with duplicated ObjectFronts in the scopes panel. r=jlast.
Regressions: 1617812

pushed a fix version to TRY: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b55a57a9bdb59c53a09a3d2f40c33188e6c53a00

  • mocha tests were failing because we didn't had getFrontByID in our conn mock
  • xpcshell test was failing because we weren't releasing object front, and I guess we were getting another actor with the same id, which means we were reusing the same ObjectFront (which was outdated).
Flags: needinfo?(nchevobbe)

yes, this is the same root cause as the node failure, my last push to TRY looks good so I'll land that again :)

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef3886a28cbc Fix issue with duplicated ObjectFronts in the scopes panel. r=jlast.

Thanks!

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Nicolas, do you think that this is material we should uplift in our last 74 beta or can it ride the 75 train? Thanks

Flags: needinfo?(nchevobbe)

ideally i would have like this to be uplifted all the way up to release, but maybe it's too late?
I'm going to request the beta uplift for now

Flags: needinfo?(nchevobbe)

Comment on attachment 9128551 [details]
Bug 1617210 - Fix issue with duplicated ObjectFronts in the scopes panel. r=jlast.

Beta/Release Uplift Approval Request

  • User impact if declined: User can't expand a property in debugger's scopes panel if there's multiple properties with the same value object
  • 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: 1. Navigate to data:text/html,<script>var hello = {hello: "world"}; x = {a: hello, b: hello}; debugger;</script>
  1. Open the debugger
  2. Reload so the debugger statement is hit and the debugger pauses
  3. In the scopes panel, expand window and then x, and then try to expand a
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): a couple of lines, DevTools only fix, with thorough automated test
  • String changes made/needed:
Attachment #9128551 - Flags: approval-mozilla-release?
Attachment #9128551 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Reproduced the initial issue using Release version 73.0.1 using Windows 10.
Verified - Fixed in latest Nightly build 75.0a1 (Build id: 20200225214332) using Windows 10, Mac OS 10.14 and Ubuntu 18.04.

Regressions: 1618122

Pascal, let's hold on the uplift for now until I investigate the performance regression caused by this

Flags: needinfo?(pascalc)

Ok sounds good

Flags: needinfo?(pascalc)
Regressed by: 1579090
No longer regressed by: 1567849
Has Regression Range: --- → yes

Too late for 73 with 74 going to RC next week.

Attachment #9128551 - Flags: approval-mozilla-release? → approval-mozilla-release-

Pascal, let's see if we can uplift this to beta as it's pretty important and we prefer to be correct and slow than incorrect and fast

Flags: needinfo?(pascalc)

Comment on attachment 9128551 [details]
Bug 1617210 - Fix issue with duplicated ObjectFronts in the scopes panel. r=jlast.

Uplift approved for 74 beta 9, thanks.

Flags: needinfo?(pascalc)
Attachment #9128551 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified - Fixed in latest Beta build 74.0b9 (Build id: 20200227210932) using Windows 10, Mac OS 10.14 and Ubuntu 18.04.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: