Closed Bug 1622238 Opened 1 year ago Closed 9 months ago

Inconsistent variable preview


(DevTools :: Debugger, defect, P1)



(firefox78 fixed)

Firefox 78
Tracking Status
firefox78 --- fixed


(Reporter: Honza, Assigned: stepan)



(2 files)

Attached image image.png


The goal is to trigger BP in getExpandedNodes function in devtools/client/shared/components/tree/TreeView.js

  1. Open DevTools select the Network panel
  2. Load any page e.g.
  3. Open Browser Toolbox and create BP in aforementioned file in getExpandedNodes method
  4. Select the first (any) request in the panel, BP should hit
  5. Check value of maxLevel and maxNodex

Value of both variables is consistent across the Debugger UI

Various places in the UI shows different values (actual value vs. Infinite)
Check out the screenshot for all the places.


Priority: P3 → P1

I was looking into this issue and was hoping to add more detail to the description. It seems that the value changes after hovering over the variable names in the object passed into getExpandedNodes(). It is at that point that the value of the variable is set to Infinity. I've attached a video below to describe what I mean:

@Alex J Garcia great video!

I did a quick check and it seems that the problem is because when hovering the findBestMatchExpression() in 'actions/preview.js' is getting expression string equal to "maxNodes = Infinity" from the 'symbols' object (instead of just "maxNodes"). This 'expression' string is then sent to evaluateJSAsync() in webConsoleActor which overwrites any previously set values to maxNodes.

I am not familiar with how the parser works to get symbols, so I don't know if we can make any changes there.
A very simple solution would be to remove with regex an equals sign and anything that follows from the 'expression' string before passing into evaluateInFrame() in 'actions/preview.js'.

Jason what do you think? Could it conflict with anything?

Flags: needinfo?(jlaster)

Hmm, it'd be great to look into getSymbols and try and understand why the expression is maxNodes = Infinity. This should be easy to do with a unit test.

Flags: needinfo?(jlaster)

Take a look at the tests in getSymbols.spec.js for how to come up with a small test case

Fixes incorrect 'expression' strings getting from the parse causing overwriting of values when hovering.

If an 'expression' string is in the form of "foo = value", when hovering over 'foo', that 'expression' string is sent to 'evaluateJSAsync()' in 'webConsoleActor' which overwrites any previously set values to 'foo'.

Assignee: nobody → stepanstava
Pushed by
Inconsistent variable preview r=jlast
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78
You need to log in before you can comment on or make changes to this bug.