Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1530,12 +1530,15 @@ class File extends ServiceObject<File> {
}

const handoffStream = new PassThrough({
final: async cb => {
final: cb => {
// Preserving `onComplete`'s ability to
// destroy `throughStream` before pipeline
// attempts to.
await onComplete(null);
cb();
onComplete(null)
.then(() => {
cb();
})
.catch(cb);
Comment on lines +1538 to +1541
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

couldn't this cause a double invocation if cb throws?

I think I would have used something such as:

.then(
  () => cb(),
  () => cb()
)

Also I'm not entirely sure how the previous code would end up with a double invocation, but I may miss some context.

},
});

Expand Down