Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
DamianEdwards opened this Issue · 1 comment

3 participants

@DamianEdwards

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 

Port of fix in 2.0.2 #2778

@halter73 halter73 was assigned
@abnanda1 abnanda1 referenced this issue from a commit
@abnanda1 abnanda1 #2739 7b4dd40
@Xiaohongt Xiaohongt was assigned
@Xiaohongt
Collaborator

Verified that connection restart successfully after going offline

@Xiaohongt Xiaohongt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.