Restarting the connection after going offline fails in js client #2778

Closed
davidfowl opened this Issue Dec 24, 2013 · 1 comment

Comments

Projects
None yet
3 participants
Owner

davidfowl commented Dec 24, 2013

Because connection._. lastActiveAt isn't cleared in stop, restarting the connection after the timeout always causes it to fail. Here's what the trace looks like:

[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Websocket opened. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332 and a connection lost timeout of 20000. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: There has not been an active server connection for an extended period of time. Stopping connection. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Stopping connection. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Fired ajax abort async = true. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Stopping the monitoring of the keep alive. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Closing the Websocket. jquery.signalR-2.1.0-pre-131129-b292.js:75
[11:10:22 GMT-0800 (Pacific Standard Time)] SignalR: Dropped the connection from the server. Restarting in 5 seconds. jquery.signalR-2.1.0-pre-131129-b292.js:75
Uncaught TypeError: Cannot read property 'pingInterval' of undefined 

Repro steps:

  • Create a connection that restarts after stopping i.e. connection.disconnected(function() { connection.start(); });
  • Turn logging on.
  • Kill the webserver and wait until the connection status to shift into disconnected
  • Restart the webserver

Expected:
The client should reconnect

Actual:
The client fails to reconnect and there's an error output in the console:

Uncaught TypeError: Cannot read property 'pingInterval' of undefined 

@ghost ghost assigned davidfowl and abnanda1 Dec 24, 2013

@ghost ghost assigned gustavo-armenta Jan 4, 2014

Contributor

gustavo-armenta commented Jan 8, 2014

tried repro and client reconnects

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