Skip to content

Conversation

@connorjclark
Copy link
Collaborator

Related to #14078. In the legacy driver, we are already handling targets via the event handlers added in the constructor. Let's not complicate things in legacy mode by doing target management in a second place (only the NetworkMonitor is what creates a TargetManager in legacy mode).

@connorjclark connorjclark requested a review from a team as a code owner June 3, 2022 00:05
@connorjclark connorjclark requested review from adamraine and removed request for a team June 3, 2022 00:05
/**
* @param {LH.Crdp.Target.AttachedToTargetEvent} event
*/
async _onTargetAttachedLegacy(event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i looked a this compared to my old solution:

image (55)

and see that you're still ensuring that networkmonitor calls network.enable for every new target. and my thing wouldn't have done that.

so.. 👍 !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we don't need to do any of this. driver is already enabling the network domain for us.

@connorjclark
Copy link
Collaborator Author

Pretty certain the failing smokes are unrelated, given they are FR and this PR only impact legacy.

1 similar comment
@connorjclark
Copy link
Collaborator Author

Pretty certain the failing smokes are unrelated, given they are FR and this PR only impact legacy.


// Legacy driver does its own target management.
// @ts-expect-error
const isLegacyRunner = Boolean(this._session._domainEnabledCounts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to remove this hack as part of #14078, or once the legacy runner is removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the latter. (once the legacy runner is removed)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, whatever comes first?

@connorjclark connorjclark merged commit 056e564 into master Jun 8, 2022
@connorjclark connorjclark deleted the legacy-no-target-manager branch June 8, 2022 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants