[FRONTEND] Add "Remove indexedDB entry" context menu entry to storage inspector

RESOLVED FIXED in Firefox 50

Status

DevTools
Storage Inspector
P3
enhancement
RESOLVED FIXED
3 years ago
a month ago

People

(Reporter: miker, Assigned: jsnajdr)

Tracking

unspecified
Firefox 50

Firefox Tracking Flags

(firefox50 fixed)

Details

Attachments

(4 attachments)

Comment hidden (empty)
(Assignee)

Comment 2

2 years ago
Created attachment 8767646 [details] [diff] [review]
Part 1: Support more key types in TableWidget
Attachment #8767646 - Flags: review?(mratcliffe)
(Assignee)

Comment 3

2 years ago
Created attachment 8767647 [details] [diff] [review]
Part 2: Change format of stores-cleared event data to support clearing any store
Attachment #8767647 - Flags: review?(mratcliffe)
(Assignee)

Comment 4

2 years ago
Created attachment 8767648 [details] [diff] [review]
Part 3: Support for removing IndexedDB records in storage inspector
Attachment #8767648 - Flags: review?(mratcliffe)
(Assignee)

Comment 5

2 years ago
Created attachment 8767649 [details] [diff] [review]
Part 4: Tests for removing IndexedDB records in storage inspector
Attachment #8767649 - Flags: review?(mratcliffe)
(Assignee)

Comment 6

2 years ago
This series of patches adds support for removing and clearing (remove all) records from IndexedDB object stores.

Part 1: Support more key types in TableWidget

Make TableWidget.remove work when a non-string (e.g., numeric) key is passed. A lot more work needs to be done until all possible IndexedDB key types are supported (that's bug 1284219), but this is a good start.

Part 2: Change format of stores-cleared event data to support clearing any store

The current structure of the "stores-cleared" event supports only clearing of "hosts", not of items at any other level. Changed the structure to support clearing data at any level. The format is now almost exactly the same as for the "stores-updated" event. Backward compatibility with the old format is kept (new frontend still understands data from older backends).

Part 3: Support for removing IndexedDB records in storage inspector

The main part: implemenation of the feature itself.

UI:
- change the onTablePopupShowing and onTreePopupShowing methods to correctly display the delete action at tree items where they are supported (host vs database vs objstore). This code is getting rather ugly and will need a refactor once we add further support for manipulating IndexedDB and Cache entries. Sending the capabilities from server seems like the best option - i.e., evolving getEditableFields into something more capable.
- the onRemoveItem and onRemoveAll methods of StorageUI now support removing items by full path, not only host.

Storage actor on backend:
- add removeItem and removeAll methods to the IndexedDB actor
- the onDatabaseRemoved notification, which sends an update event to the UI, was refactored into a more generic onItemUpdated notification that can handle more types of updates ("deleted", "cleared") to more IndexedDB item types.
- slightly improved error handling and reporting

Part 4: Tests for removing IndexedDB records in storage inspector
- updated the existing tests for delete actions to test IndexedDB, too
Assignee: nobody → jsnajdr
Attachment #8767646 - Flags: review?(mratcliffe) → review+
Attachment #8767647 - Flags: review?(mratcliffe) → review+
Attachment #8767648 - Flags: review?(mratcliffe) → review+
Attachment #8767649 - Flags: review?(mratcliffe) → review+
Awesome set of changes... thanks for working on this.
Priority: -- → P3
(Assignee)

Comment 8

2 years ago
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #7)
> Awesome set of changes... thanks for working on this.

Thanks for the quick review, Mike!
Keywords: checkin-needed

Comment 9

2 years ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/ea99abdb125d
Part 1: Support more key types in TableWidget r=mratcliffe
https://hg.mozilla.org/integration/fx-team/rev/8f8bfc4fab08
Part 2: Change format of stores-cleared event data to support clearing any store r=mratcliffe
https://hg.mozilla.org/integration/fx-team/rev/caf2ddae3120
Part 3: Support for removing IndexedDB records in storage inspector r=mratcliffe
https://hg.mozilla.org/integration/fx-team/rev/d06d81ac4cf2
Part 4: Tests for removing IndexedDB records in storage inspector r=mratcliffe
Keywords: checkin-needed

Comment 10

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/ea99abdb125d
https://hg.mozilla.org/mozilla-central/rev/8f8bfc4fab08
https://hg.mozilla.org/mozilla-central/rev/caf2ddae3120
https://hg.mozilla.org/mozilla-central/rev/d06d81ac4cf2
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox50: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50

Updated

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