Closed Bug 1498987 Opened Last year Closed Last year

localStorage and sessionStorage display "key": "key" instead of "key": "value" in developer console

Categories

(DevTools :: Console, defect, P1, major)

61 Branch
defect

Tracking

(firefox-esr60 unaffected, firefox63 wontfix, firefox64 verified, firefox65 verified)

VERIFIED FIXED
Firefox 65
Tracking Status
firefox-esr60 --- unaffected
firefox63 --- wontfix
firefox64 --- verified
firefox65 --- verified

People

(Reporter: heiselmayer, Assigned: miker)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0

Steps to reproduce:

I listed all values of sessionStorage (or localStorage) in the developer console by typing "sessionStorage" (or "localStorage").




Actual results:

All items in the object are listed as "<key>": "<key>".


Expected results:

All items in the object should be listed as "<key>": "<value>".
Component: Untriaged → Console
Product: Firefox → DevTools
Thanks a lot for the report heiselmayer.

61 is impacted, 60 is not.
Here's the grip we receive from the server, with a localStorage containing a "myKey": "myValue" item

```json
{
  "type": "object",
  "actor": "server1.conn2.child1/obj27",
  "class": "Storage",
  "extensible": true,
  "frozen": false,
  "sealed": false,
  "ownPropertyLength": 1,
  "preview": {
    "kind": "Object",
    "ownProperties": {
      "myKey": {
        "configurable": true,
        "writable": true,
        "enumerable": true,
        "value": "myKey"
      }
    },
    "ownSymbols": [],
    "ownPropertiesLength": 1,
    "ownSymbolsLength": 0,
    "safeGetterValues": {
      "length": {
        "getterValue": 1,
        "getterPrototypeLevel": 1,
        "enumerable": true,
        "writable": true
      }
    }
  }
}
```

We can see the preview.ownProperties.myKey.value being "myKey", which is wrong.
The culprit seems to be here: https://searchfox.org/mozilla-central/rev/3a54520d8d2319a4116866371ed3d9ed2ec0cc2b/devtools/server/actors/object.js#644-654 , where we return `value: name`, instead of returning the value.

Issue was introduced in Bug 1454103.

Mike, would you have time to look into this ? If not, I can.
Severity: normal → major
Status: UNCONFIRMED → NEW
Depends on: 1454103
Ever confirmed: true
Flags: needinfo?(mratcliffe)
Priority: -- → P1
Version: 62 Branch → 61 Branch
I'll add it to my list.
Flags: needinfo?(mratcliffe)
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Added nchevobbe for review.
Pushed by mratcliffe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5197974fa161
localStorage and sessionStorage display key: key instead of key: value in developer console r=nchevobbe
https://hg.mozilla.org/mozilla-central/rev/5197974fa161
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Comment on attachment 9019049 [details]
Bug 1498987 - localStorage and sessionStorage display key: key instead of key: value in developer console

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Bug 1454103

User impact if declined: Wrong information displayed in the console when logging localStorage/sessionStorage

Is this code covered by automated tests?: Yes

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: Yes

If yes, steps to reproduce: 1. Go to mozilla.org
2. Open the console
3. Evaluate `localStorage.setItem("myKey", "myValue"); localStorage;`

Expected result: in the `Storage` object displayed, you should see `myKey: "myValue"` (before the fix, it was `myKey: "myKey"`)

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): One-liner fix with automated test

String changes made/needed:
Attachment #9019049 - Flags: approval-mozilla-beta?
Comment on attachment 9019049 [details]
Bug 1498987 - localStorage and sessionStorage display key: key instead of key: value in developer console

Fixes incorrect information in the console when logging localStorage/sessionStorage. Approved for 64.0b4.
Attachment #9019049 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
Verified as fixed on Firefox Nightly 65.0a1 (2018-10-31) and on Firefox 64.0b5 on Windows 10 x 64, Windows 7 x32, Mac OS X 10.14 and on Ubuntu 16.04 x64.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.