"Parsed value" section gets duplicated when editing a local storage entry

RESOLVED FIXED in Firefox 48

Status

RESOLVED FIXED
3 years ago
5 months ago

People

(Reporter: pbro, Assigned: jsnajdr)

Tracking

unspecified
Firefox 48
Dependency tree / graph

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
STR:
- (this depends on bug 1231155)
- open the mozilla.org site
- open the console
- enter localStorage.setItem('test', '{"foo": "bar"}')
- open the storage inspector
- switch to the local storage item in the tree-view
- click on the 'test' item
=> Notice that the sidebar opens and shows the JSON value as a parsed JS object

- now, double-click on the '{"foo": "bar"}' value in the table
- edit bar to bar2 instead
- press enter
=> Notice that the "Parsed Value" section in the sidebar is now duplicated, there are 2 parsed JS objects in there.
(Assignee)

Updated

3 years ago
Assignee: nobody → jsnajdr
(Assignee)

Comment 1

3 years ago
Created attachment 8743781 [details] [diff] [review]
'Parsed value' section gets duplicated when editing.

This bug happens because:
1. After editing a value, displayObjectSidebar() is called twice in a quick succession. This is because the row get reselected [1] and updated [2] as the result of the edit.
2. In displayObjectSidebar(), the UI update is broken into two parts - first it's cleared and a part of the content is added, then it waits for an async action (getting value of a string grip), and then finishes the UI update. Race conditions happen that cause the "Parsed Value" section to be duplicated.

Fixed this by refactoring the displayObjectSidebar() method to first do any async actions, and then do the whole UI update synchronously.
Attachment #8743781 - Flags: review?(mratcliffe)
Comment on attachment 8743781 [details] [diff] [review]
'Parsed value' section gets duplicated when editing.

Review of attachment 8743781 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good... r+ on green try.
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 5

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b6f71c9b42b9
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48

Updated

3 years ago
Depends on: 1280548
Attachment #8743781 - Flags: review?(mratcliffe)

Updated

5 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.