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: close file stream when error #7094

Merged
merged 2 commits into from Aug 31, 2022

Conversation

HppZ
Copy link
Contributor

@HppZ HppZ commented Aug 26, 2022

file stream should be closed when error.

@changeset-bot
Copy link

changeset-bot bot commented Aug 26, 2022

🦋 Changeset detected

Latest commit: f593aba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
builder-util-runtime Patch
builder-util Patch
app-builder-lib Patch
dmg-builder Patch
electron-builder Patch
electron-publish Patch
electron-updater Patch
electron-builder-squirrel-windows Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit f593aba
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/630f7e248a2d0e00095c279a
😎 Deploy Preview https://deploy-preview-7094--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

options.callback(error)
}
fileOut.close()
options.callback(error)
Copy link
Collaborator

@mmaietta mmaietta Aug 28, 2022

Choose a reason for hiding this comment

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

Great callout on closing the stream

I think we still need this though:

if (!options.options.cancellationToken.cancelled) {
       options.callback(error)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great callout on closing the stream

I think we still need this though:

if (!options.options.cancellationToken.cancelled) {
       options.callback(error)
}

callback should be invoked even if the downloading is cancelled by user.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I disagree though, as user cancelation is an explicit action that I think should not resolve into an error event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree!~

@mmaietta mmaietta merged commit 1023a93 into electron-userland:master Aug 31, 2022
@github-actions github-actions bot mentioned this pull request Aug 31, 2022
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.

None yet

2 participants