Investigate removing shouldCloseClient logic from the target
Categories
(DevTools :: Framework, task, P3)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
Details
The shouldCloseClient is a property of the target-front. If true, the target-front destroy will close the corresponding DebuggerClient:
if (this.shouldCloseClient) {
try {
await this._client.close();
} catch (e) {
// Ignore any errors while closing, since there is not much that can be done
// at this point.
console.warn("Error while closing client:", e);
}
// ...
}
This property is true only for:
As we can see, this property is also only relevant for top level targets. When trying to create top level targets from the WatcherActor, this property becomes complicated to handle. Typically, for a navigation/reload, we will attempt to destroy the previous top level BrowsingContextTargetFront, before the new target is created. So we risk destroying the client, because we don't realize that this is just a target-switching and we will get a new target soon.
Moving this outside of the target (maybe to the descriptor) would help. For about:debugging targets, we won't have descriptors for all targets though.
[1] remote debugging targets use the same client that was created for about:debugging, so they don't close the client when the target is closed. However they use another codepath to "close" the toolbox. See initToolbox/onTargetDestroyed in toolbox-init.js
Comment 1•3 years ago
|
||
Bug 1631451 is moving this attribute up to the descriptor front.
Description
•