Closed Bug 1710647 Opened 3 years ago Closed 3 years ago

resourceCommand is setting listeners on targetFront that it never removes

Categories

(DevTools :: Framework, defect)

defect

Tracking

(Fission Milestone:M7a, firefox90 fixed)

RESOLVED FIXED
90 Branch
Fission Milestone M7a
Tracking Status
firefox90 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

(Whiteboard: dt-fission-m3-mvp)

Attachments

(1 file)

we set listeners on targetFront in onTargetAvailable (devtools/shared/commands/resource/resource-command.js#324,346-357 ) , but those are never removed.

So if a consumer does:

  • resourceCommand.watchResources(...)
  • resourceCommand.unwatchResources(...)
  • resourceCommand.watchResources(...)

after the second call, we'll have 2 event listeners set for the same targetFront, which could lead to duplicate resources.

Event listeners were set on target available, but they were never removed, which
could cause issue if a consumer was watching/unwatching for resources multiple
times.
A test (that was failing without this patch), is added to ensure we don't regress this.
Note that the test is still incorrect and will be properly fixed in Bug 1710674.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp
Blocks: 1644360
Fission Milestone: --- → M7a
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/df407e796c90
[devtools] Remove targetFront event listeners in resourceCommand#_unwatchAllTargets. r=ochameau,bomsy.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: