Closed Bug 1717979 Opened 3 years ago Closed 3 years ago

DevTools watch methods should throw when provided with unknown resource/target types

Categories

(DevTools :: Framework, task, P3)

task

Tracking

(firefox91 fixed)

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The following destroy code was failing to unwatch REFLOW resources properly because it used ResourceCommand.REFLOW instead of ResourceCommand.TYPES.REFLOW.

https://searchfox.org/mozilla-central/rev/f213971fbd82ada22c2c4e2072f729c3799ec563/devtools/client/inspector/inspector.js#1561-1566

  untrackReflowsInSelection() {
    this.commands.resourceCommand.unwatchResources(
      [this.commands.resourceCommand.REFLOW],
      {
        onAvailable: this.onReflowInSelection,
      }
    );
  },

This kind of mistake could be prevented at framework level by validating the types passed to watch/unwatch methods.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d248b995cc49
[devtools] watch/unwatch APIs should throw when provided with invalid types r=ochameau
Blocks: 1716960
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: