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

Add some test and fix a rare network condition that caused a crash #19

Merged
merged 8 commits into from
May 29, 2013

Conversation

sarfata
Copy link
Member

@sarfata sarfata commented May 9, 2013

I am opening this branch to fix #18. In the process, I have added some test to reproduce my bug and added some very simple tests on basic features.

This will need to be expanded but it sets the base for a test infrastructure.

This is not quite ready to be merged yet, I need to double-check that my fix works and does not have any side-effect but I am opening this pull-request to discuss it with you guys ( ping @tmeasday / @emgee3).

FYI - I am using rewire and sinon (new dependencies) to mock WebSocket.

@emgee3
Copy link
Member

emgee3 commented May 10, 2013

@sarfata this looks good to me.

You have a commented-out test that I also couldn't get to work with the fake timer, but worked fine with a setTimeout.

sarfata added 3 commits May 27, 2013 19:10
This fixes a bug because I would manually start a recovery but the socket
would also fire a socket-error event which would cause another attempt to
recover. Very quickly, each attempt would multiply and it got really
really messy...
 * A socket send error should not throw an error right away - we will wait
 for the socket to send the error itself.
 * De-commented the auto-reconnect test. Use setTimeout() instead of sinon.tick()
@sarfata
Copy link
Member Author

sarfata commented May 27, 2013

Thanks @emgee3 for the feedback!

@tmeasday I would like to publish this as 0.3.3 - is this ok with you? Can you give me npm publish-right (sarfata/[email protected])? Or do you want to do it?

@tmeasday
Copy link
Member

Done! Sorry about the silence at my end.

@emgee3 - would you like to be added as an npm package owner too?

PS if either of you are feeling adventurous, I'm fairly sure that nodejs/node-v0.x-archive#5557 (comment) is affecting the library via a problem with ws. I know it's affecting Meteorite.

@emgee3
Copy link
Member

emgee3 commented May 28, 2013

@tmeasday I guess that would be a good idea. [email protected] on npm

@tmeasday
Copy link
Member

@emgee3 -- it can't find you. Do you have a username?

On Tuesday, 28 May 2013 at 1:30 PM, emgee3 wrote:

@tmeasday (https://github.com/tmeasday) I guess that would be a good idea. [email protected] (mailto:[email protected]) on npm


Reply to this email directly or view it on GitHub (#19 (comment)).

@emgee3
Copy link
Member

emgee3 commented May 28, 2013

On NPM it's just emgee

@tmeasday
Copy link
Member

Cool, sorted

sarfata added a commit that referenced this pull request May 29, 2013
Add some test and fix a rare network condition that caused a crash
@sarfata sarfata merged commit ff8b184 into master May 29, 2013
@emgee3 emgee3 deleted the error-notopened branch March 31, 2014 10:03
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

Successfully merging this pull request may close these issues.

Uncatched exception "Error(not-opened)"
3 participants