Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Corrupted application state from stale connections #339
This is a cross-post from http://stackoverflow.com/questions/12395387/how-can-meteor-handle-stale-connections
How to reproduce the issue:
Not sure if Meteor can already handle this scenario, or should this be a "data validation" feature request?
referenced this issue
Sep 19, 2012
This may need some work on a low level, a ping packet should be periodically sent to the server through the open websocket, which in turn should respond with a pong. If a pong is not received within say 1 minute, any data that has been sent to the server since the last pong should be validated with the server..
I think they do work because after a while Meteor.status().connected does become false, presumably as a result of the sockjs heartbeat implementation. However as a solution it may still not be robust enough because data transmitted while the connection was stale may have been lost and neither the server nor the client will check that.
I would think that a robust solution would be to perform some sort of 2 way handshake when sending data, i.e. send 1k of data from the client and ask the server if it received that data - then if the server replies with 1024 bytes received, then the transmission has been validated..