I can tell this is a troublesome bug to resolve, especially when it does not happen to you. But I have an idea on why it has happened on my system.
First, I am running on a WiFi network and occasionally the WiFi connection display pops up and sayd the connection was connected, as though it had been disconnected momentarily. If the auth check were to go through at the right time maybe that would cause a problem.
-- Brennan Stehling Offwhite.net LLC brennan@offwhite.net
On Fri, 8 Sep 2006, Brennan Stehling wrote:
First, I am running on a WiFi network and occasionally the WiFi connection display pops up and sayd the connection was connected, as though it had been disconnected momentarily. If the auth check were to go through at the right time maybe that would cause a problem.
OK, just snooped at the JS code, and found this in app.js:
// use an image to send a keep-alive siganl to the server this.send_keep_alive = function() { var d = new Date(); this.http_request('keep-alive', '_t='+d.getTime()); };
Now, I'm not an AJAX or JS expert, so I don't know what this.http_request() returns, but the function could retry if the connection wasn't successfull.
Any ideas?
-- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18
Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática | '@' || 'unl.edu.ar'; Universidad Nacional | DBA, Programador, del Litoral | Administrador
The way a request is done with AJAX is with the XmlHttpRequest object. With it you can request a Url and do so asynchronously. So when you submit the request the Javascript will proceed without waiting for that response and if you happen to send more than 1 request in a short period there is no assurance that they will be returned in the same order. And you must assume that a request may also fail.
As a part of the assumption that requests may fail, the XmlHttpRequest object raises events based on what is happening with the requst in the readyState property in the response object. It has these properties.
0 = uninitialized, 1 = open, 2 = sent, 3 = receiving and 4 = loaded
It also provides a status for the request which may be a Not Found, OK or other status. If a request does fail due to the server being momentarily unreachable or a server error you should be able to detect it and then prepare and send a new request to make another attempt. And after the response does experience a failure it could take action. For example, if it returned an error it may delay further communications with the server for a period until a success request to the server can be completed, and if the connections fail for a couple of minutes the application could be placed into an offline mode.
And once it is in an offline mode it could attempt to reach the server every 5 minutes to check if it can return to the online mode.
Brennan
On Fri, 8 Sep 2006 17:41:49 -0300 (ART), Martin Marques martin@bugs.unl.edu.ar wrote:
On Fri, 8 Sep 2006, Brennan Stehling wrote:
First, I am running on a WiFi network and occasionally the WiFi connection display pops up and sayd the connection was connected, as though it had been disconnected momentarily. If the auth check were to go through at the right time maybe that would cause a problem.
OK, just snooped at the JS code, and found this in app.js:
// use an image to send a keep-alive siganl to the server this.send_keep_alive = function() { var d = new Date(); this.http_request('keep-alive', '_t='+d.getTime()); };
Now, I'm not an AJAX or JS expert, so I don't know what this.http_request() returns, but the function could retry if the connection wasn't successfull.
Any ideas?
-- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18
Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática | '@' || 'unl.edu.ar'; Universidad Nacional | DBA, Programador, del Litoral | Administrador ---------------------------------------------------------)
-- Brennan Stehling Offwhite.net LLC brennan@offwhite.net