question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Callback fired twice in src/braintree/http.coffee

See original GitHub issue

Yesterday I had an issue where the callback in http.coffee fires twice.

https://github.com/braintree/braintree_node/blob/master/src/braintree/http.coffee#L59-L91

One callback happens when the http client’s setTimeout function fires. The other happens in the error event handler when the socket closes.

Should this library be responsible for firing the callback only once?

I noticed there is a non running test here, https://github.com/braintree/braintree_node/blob/master/spec/integration/braintree/http_spec.coffee#L52-L64

Has anyone else experienced the double callback?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
raymondbergcommented, May 11, 2016

Changes to address this have been released in 1.38.0. Closing for now, but feel free to reopen if this does not address the issue. https://github.com/braintree/braintree_node/commit/c74ae1210a7437d4955fd33d3fb1f6811a98f39c

Thanks for reporting this, @wlaurance!

1reaction
ibonevacommented, May 2, 2016

Hey @wlaurance

We looked into this today and this does seem to be an issue. We’re going to look into this further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JQuery ajax success fired twice, because of .done callback
Now, the above code fires the success handler for the request twice, but's its been there for more than a year & no...
Read more >
Preventing callbacks from accidentally being called twice
When we run the example above, and the url is cached, the callback is actually called twice! It's easy to think of calling...
Read more >
Contract.new callback being called twice. · Issue #500 - GitHub
The fact that a callback is fired twice is just wrong. The very definition of callback is, that is called exactly once.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found