Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

fix(gcs-resumable-upload): Stop Duplicate Response Handlers on Retries#1764

Merged
danielbankhead merged 1 commit intomainfrom
handle-resumable-response-once
Jan 26, 2022
Merged

fix(gcs-resumable-upload): Stop Duplicate Response Handlers on Retries#1764
danielbankhead merged 1 commit intomainfrom
handle-resumable-response-once

Conversation

@danielbankhead
Copy link
Copy Markdown
Contributor

Porting fix from googleapis/gcs-resumable-upload#502:

Previously, startUploading would setup a 'response' event listener for passing responses to responseHandler - this is problematic in the event of a retry as the retry would create its own request (thus previous requests would trigger responseHandler as well).

Instead, we can accomplish the desired functionality by checking makeRequestStream's return value.

@danielbankhead danielbankhead requested review from a team January 26, 2022 19:18
@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Jan 26, 2022
Copy link
Copy Markdown
Contributor

@ddelgrosso1 ddelgrosso1 left a comment

Choose a reason for hiding this comment

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

Thanks for porting this over

@danielbankhead danielbankhead merged commit fe44871 into main Jan 26, 2022
@danielbankhead danielbankhead deleted the handle-resumable-response-once branch January 26, 2022 19:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storage Issues related to the googleapis/nodejs-storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants