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(download): do not stall BrowserContext.close waiting for downloads #5424

Merged
merged 1 commit into from Feb 15, 2021
Merged

fix(download): do not stall BrowserContext.close waiting for downloads #5424

merged 1 commit into from Feb 15, 2021

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Feb 11, 2021

We might not ever get the "download finished" event when closing the context:

  • in Chromium, for any ongoing download;
  • in all browsers, for failed downloads.

This should not prevent closing the context. Instead of waiting for the
download and then deleting it, we force delete it immediately and reject
any promises waiting for the download completion.

References #5273.

src/server/browserContext.ts Outdated Show resolved Hide resolved
@dgozman dgozman marked this pull request as draft February 12, 2021 00:08
@dgozman dgozman marked this pull request as ready for review February 13, 2021 18:17
We might not ever get the "download finished" event when closing the context:
- in Chromium, for any ongoing download;
- in all browsers, for failed downloads.

This should not prevent closing the context. Instead of waiting for the
download and then deleting it, we force delete it immediately and reject
any promises waiting for the download completion.
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.

None yet

2 participants