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

adds timeout to socket event on client side #263

Merged
merged 2 commits into from
Apr 26, 2017
Merged

Conversation

emilyb7
Copy link
Collaborator

@emilyb7 emilyb7 commented Apr 23, 2017

builds on #256

if the browser doesn't get a response from the socket within 20 seconds of emitting a 'goal' event, the update is cancelled and 'pendingSync' is set to false.

related #152

@emilyb7
Copy link
Collaborator Author

emilyb7 commented Apr 23, 2017

potential problem: what if the network's just really slow and it takes more than 20 seconds to get a response from the socket? then everything would get out of sync... not sure how to solve this though...

@MHemsley
Copy link

MHemsley commented Apr 24, 2017 via email

@emilyb7 emilyb7 changed the base branch from socket-manager-client to master April 26, 2017 09:49
@des-des
Copy link
Collaborator

des-des commented Apr 26, 2017

@MHemsley I think this timeout is okay, 20 seconds is a long time for a very small piece of data, so I think it is enough. Mostly, this timeout will only come into play if there is an error on the server or a serious connectivity problem. In this case, the client will retry until it succeeds..

@des-des des-des merged commit 0e632f9 into master Apr 26, 2017
@des-des des-des deleted the socket-event-timer branch April 26, 2017 10:51
@MHemsley
Copy link

@des-des Agreed, we'll soon find out if there are issues. Is there a limit to the retries?

@des-des
Copy link
Collaborator

des-des commented Apr 26, 2017

for reference: socketio/socket.io-client-java#309

@des-des
Copy link
Collaborator

des-des commented Apr 26, 2017

@MHemsley I think for MVP this is robust enough.

There are more complex ways of handling this sort of problem. For example if our number of users was in the tens of thousands, this kind of retry behaviour might overload a server...

If we have a couple of user connected at any one time, even if both of them are retrying every 20s 24 hours a day, this is not problem (and should not happen anyway)..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants