Closed Bug 1654998 Opened 4 years ago Closed 4 years ago

Add button is displayed for storage types which don't support adding items

Categories

(DevTools :: Storage Inspector, task, P3)

task

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(3 files, 1 obsolete file)

We store the supportsXXX flags directly on the UI module instance, whereas the values differ for each type.

        this.actorSupportsAddItem = await target.actorHasMethod(
          type,
          "addItem"
        );
        this.actorSupportsRemoveItem = await target.actorHasMethod(
          type,
          "removeItem"
        );
        this.actorSupportsRemoveAll = await target.actorHasMethod(
          type,
          "removeAll"
        );
        this.actorSupportsRemoveAllSessionCookies = await target.actorHasMethod(
          type,
          "removeAllSessionCookies"
        );

https://searchfox.org/mozilla-central/rev/227f22acef5c4865503bde9f835452bf38332c8e/devtools/client/storage/ui.js#783-798

It more or less works because the values are recomputed every time we select a category, but it fails in several edge cases:

  • trying to right click on a category while another category is selected
  • toolbar is not updated correctly, meaning the addItem icon is always displayed even when it is not possible

We are migrating the actorHasMethod calls to traits in Bug 1654762, this is a followup to fix the various bugs related to the way those "supports" traits are handled.

Depends on D84689

This is optional but the current implementation barely works.
We store the supportsXXX flags directly on the UI module instance, whereas the values differ for each type.

It more or less works because the values are recomputed every time we select a category, but it fails in several edge cases:

  • trying to right click on a category while another category is selected
  • toolbar is not updated correctly, meaning the addItem icon is always displayed even when it is not possible

I can perfectly move that to another bug if that's preferable.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Traits support was added to the storage actor in FF80.
Firefox release is now FF81 so we can cleanup the related backward compatibility code.

Attachment #9165838 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/69d93b75a629
[devtools] Remove backward compatibility code from storage-ui::_readSupportsTraits r=ladybenko
https://hg.mozilla.org/integration/autoland/rev/1ffeab42bb1e
[devtools] Check supports traits directly on individual storage fronts r=ladybenko
https://hg.mozilla.org/integration/autoland/rev/0f1a4d0bad71
[devtools] Add a test to check the Add button is hidden for indexedDB r=ladybenko
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: