Closed
Bug 1663896
Opened 4 years ago
Closed 4 years ago
Simultaneous calls to watchResources lead to missing resources from targets
Categories
(DevTools :: Framework, task, P3)
DevTools
Framework
Tracking
(firefox82 fixed)
RESOLVED
FIXED
82 Branch
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
Details
Attachments
(2 files)
If you perform two calls to resourceWatcher.watchResources
"simultaneously", the second call will not be able to retrieve existing resources coming from targets.
This comes from the implementation of _watchAllTargets
:
async _watchAllTargets() {
if (this._isWatchingTargets) {
return;
}
this._isWatchingTargets = true;
await this.targetList.watchTargets(
this.targetList.ALL_TYPES,
this._onTargetAvailable,
this._onTargetDestroyed
);
}
Based on this, the first call to watchResources
will flip _isWatchingTargets
to true, and the second call will bypass it. It means the second call will jump straight to the "startListening" step, before the "resource-available-form" listeners have been added on the existing targets.
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D89583
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b0b56040bb4e Always wait for _watchAllTargets to resolve in DevTools ResourceWatcher r=ochameau https://hg.mozilla.org/integration/autoland/rev/1ed7fee9c145 Remove async for TargetList::unwatchTargets and update call sites r=ochameau
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b0b56040bb4e
https://hg.mozilla.org/mozilla-central/rev/1ed7fee9c145
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox82:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•