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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop File.download from truncating output file on failure #1720

Merged
merged 4 commits into from
Nov 22, 2021

Conversation

shaffeeullah
Copy link
Contributor

Fixes #1713 馃

@shaffeeullah shaffeeullah requested review from a team as code owners November 19, 2021 21:25
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 19, 2021
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Nov 19, 2021
const fileContents = 'abcdefghijklmnopqrstuvwxyz';

fileReadStream.on('resume', () => {
fileReadStream.emit('data', fileContents);
Copy link
Member

Choose a reason for hiding this comment

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

Minor: for future reviewers, we may want to leave a comment as to why we're explicitly emitting twice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think the test title is sufficient? If not, we should change the test title to something more descriptive.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the title is sufficient, describes what it is testing succinctly enough.

Copy link
Member

@danielbankhead danielbankhead left a comment

Choose a reason for hiding this comment

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

Looks good!

@shaffeeullah shaffeeullah merged commit d77979b into main Nov 22, 2021
@shaffeeullah shaffeeullah deleted the shaffeeullah/dontoverwritefile branch November 22, 2021 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File.download truncates output file on failure
3 participants