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

Error: Callback was already called #130

Open
Buyachaka opened this issue May 29, 2020 · 1 comment
Open

Error: Callback was already called #130

Buyachaka opened this issue May 29, 2020 · 1 comment

Comments

@Buyachaka
Copy link

Hello, I found a stack trace leading to a callback error of being called multiple times.

I narrowed it down where it happens in my code, and where it is happening should not be a problem on my side.

Checking the vimeo.js file I can see that on "Vimeo.prototype.request" it would call "_handleRequest" using the same callback as when it is checking for req.on('error").

If both were to run at the same request, that is a request that was sent and then received an error, this would cause the callback to be called twice causing the stacktrace.

Version: [email protected]

@Buyachaka
Copy link
Author

Buyachaka commented Jun 2, 2020

Update:
I was able to reproduce the error by closing my internet connection right after the first request is sent.
Apparently, the line 138 gets called twice. That is caused by a retry on the "request" module, making the callback function with the error message to run twice.
Adding a req.abort after the first error seems to avoid the problem, preventing the default retry behavior.

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