Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parent step for API calls inside waitForEvent callback #33409

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yury-s
Copy link
Member

@yury-s yury-s commented Nov 2, 2024

Fixes #33186

Copy link
Contributor

github-actions bot commented Nov 2, 2024

Test results for "tests 1"

36791 passed, 630 skipped
✔️✔️✔️

Merge workflow run.

@@ -39,6 +39,17 @@ class ZoneManager {
return this._asyncLocalStorage.run(undefined, func);
}

currentZoneBefore(type: ZoneType): ZoneReference {
let zone = this._asyncLocalStorage.getStore();
while (zone && zone.type === type)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand the logic here.


constructor(channelOwner: ChannelOwner<channels.EventTargetChannel>, event: string) {
this._waitId = createGuid();
this._channelOwner = channelOwner;
// Save current chain before the wait for event API call (we don't nest API calls)
// and restore it later to find proper parent for the event listener.
this._savedZone = zones.currentZoneBefore('apiZone');
Copy link
Member

Choose a reason for hiding this comment

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

What does it mean zone before zone? Do you mean simply current zone?

@@ -53,6 +64,20 @@ class ZoneManager {
}
}

export class ZoneReference {
Copy link
Member

Choose a reason for hiding this comment

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

What's is zone reference? I thought zone was a zone reference already. Real zone is the async context. I don't think we need 3 types, should be just async context and a logical apiCall zone with a parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Playwright report showing waitForResponse logs outside test step
2 participants