-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Refresh page, or re-establish socket.io when connection is lost #84
Comments
I'll make sure to tweet each deploy in the future, if I need to deploy before I can get an automated refresh in place. Follow me at @lefnire |
So (if I understand you correctly) I can't do anything at the moment about the "offline" messages which keep appearing apart from not to change/log anything because it won't save, and just to refresh the page to check if it's back online? |
unfortunately, at present that is correct. I'm working on fixing this bug, and it's 99% a result of the huge traffic surge from today - so once that dies down we should have breathing room. If you can't wait to use the app, I'd say install on your machine at present (it's pretty easy actually), but I'm keep you posted on this thread as progress is made. |
Okay thank you. What difference will having it installed on my machine make? Will it just save my progress locally and then upload it to the main servers whenever they're online or does it run completely on my computer? |
yeah, it would be completely on your computer. it would work smoothly, but you're right you'd miss out on social stuff & website integrations, so maybe just hang tight for now |
Will do :) |
Idea for a temporary patch: |
If you want to give users a few minutes of heads up before you deploy a new version, there's this little service: http://informuser.com/ |
Could you store all the information being sent to the server in LocalStorage if there isn't a heartbeat from the server? That is, when the page detects the server being down (socket.io should send a 'disconnect' when it goes down), it will store whatever info you send to node.js in some form on LocalStorage. Then, have a heartbeat check happening on client side (just do a setTimeout() that asks for a simple message). If the heartbeat checks out, submit the stored data. This might be totally off-base from what you want, but it's an idea. I don't know if Socket.io has this built in - been a few months since I've done work with it. |
Derby uses memory store for when there's no connection. It stores On Mon, Feb 4, 2013 at 5:29 PM, Tim Turner notifications@github.com wrote:
|
this actually happens now, awesome. don't know if it was a recent racer release |
Custom Day Start: change condition on when we run cron
Habit uses Socket.io to maintain persistence over real-time. If the server crashes and needs a restart, or if I push a fix - the session is broken between active clients and the server. The client flickers 'Disconnected' for a while, then when the server comes back online that message disappears - however, Socket hasn't made a proper re-connection, and any changes made between the time the server came down, and the time the user refreshes the page are completely lost.
The first thing to fix of course, is the server crashing for any reason. But that's a work in progress, and often out of my hands (I'm using the bleeding-edge Derby). Second thing to fix is to announce when I'm restarting the server (Twitter?). The biggest fix, however, will be to automatically refresh the page when the server connection has been re-detected. Possibly upgrading Socket.io, as well?
The text was updated successfully, but these errors were encountered: