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

Download callback can be triggered twice. #426

Closed
nicolasnoble opened this issue Nov 3, 2018 · 1 comment
Closed

Download callback can be triggered twice. #426

nicolasnoble opened this issue Nov 3, 2018 · 1 comment

Comments

@nicolasnoble
Copy link
Contributor

This was already reported, and a tentative fix is in #408. However, this fix doesn't do enough. The close callback can also be called after an error, and the fix only protects the case when the download happens correctly. One needs to also protect the error cases or the double callback problem will happens in this case.

nicolasnoble added a commit to nicolasnoble/node-pre-gyp that referenced this issue Nov 3, 2018

Verified

This commit was signed with the committer’s verified signature.
invasy Vasiliy Polyakov
Fixes issue mapbox#426.
The `close` event will also be emitted for error cases. If a download fails, then the callback will be invoked twice with a failure, triggering the fallback-to-source case twice. This will spawn two instances of node-gyp which will most likely corrupt the build.
nicolasnoble added a commit to nicolasnoble/node-pre-gyp that referenced this issue Nov 3, 2018

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Fixes issue mapbox#426.
The `close` event will also be emitted for error cases. If a download fails, then the callback will be invoked twice with a failure, triggering the fallback-to-source case twice. This will spawn two instances of node-gyp which will most likely corrupt the build.
nicolasnoble added a commit to nicolasnoble/node-pre-gyp that referenced this issue Nov 3, 2018

Verified

This commit was signed with the committer’s verified signature.
invasy Vasiliy Polyakov
Fixes issue mapbox#426.
The `close` event will also be emitted for error cases. If a download fails, then the callback will be invoked twice with a failure, triggering the fallback-to-source case twice. This will spawn two instances of node-gyp which will most likely corrupt the build.
@nicolasnoble
Copy link
Contributor Author

#428 fixes this one, and node-pre-gyp 0.12.0 has been released with this fix.

hyj1991 pushed a commit to X-Profiler/node-pre-gyp that referenced this issue Jun 16, 2023
Fixes issue mapbox#426.
The `close` event will also be emitted for error cases. If a download fails, then the callback will be invoked twice with a failure, triggering the fallback-to-source case twice. This will spawn two instances of node-gyp which will most likely corrupt the build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant