This repository was archived by the owner on Mar 3, 2026. It is now read-only.
fix: remove async from final function which causes double invocation …#2094
Merged
ddelgrosso1 merged 2 commits intogoogleapis:mainfrom Oct 25, 2022
Merged
fix: remove async from final function which causes double invocation …#2094ddelgrosso1 merged 2 commits intogoogleapis:mainfrom
ddelgrosso1 merged 2 commits intogoogleapis:mainfrom
Conversation
Contributor
Author
|
I believe this is related to nodejs/node#39535 which can cause double invocation of callbacks under the same situation we had in the code here. |
danielbankhead
approved these changes
Oct 25, 2022
julienw
reviewed
Nov 2, 2022
Comment on lines
+1538
to
+1541
| .then(() => { | ||
| cb(); | ||
| }) | ||
| .catch(cb); |
There was a problem hiding this comment.
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.
ddelgrosso1
added a commit
to ddelgrosso1/nodejs-storage
that referenced
this pull request
Dec 5, 2022
googleapis#2094) * fix: remove async from final function which causes double invocation of callback * add catch clause
ddelgrosso1
added a commit
to ddelgrosso1/nodejs-storage
that referenced
this pull request
Dec 5, 2022
googleapis#2094) * fix: remove async from final function which causes double invocation of callback * add catch clause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…of callback
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #2082 🦕