Closed Bug 1260380 Opened 9 years ago Closed 9 years ago

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

Categories

(DevTools :: Storage Inspector, defect)

defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed

People

(Reporter: pbro, Assigned: jsnajdr)

References

Details

Attachments

(1 file)

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: nobody → jsnajdr
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.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Depends on: 1280548
Attachment #8743781 - Flags: review?(mratcliffe)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: