You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On upgrade failure, pass along connected error and reset connection serial
Resetting the message serial is a bit of a hack - fixes the problem for
now but may change in the future depending on the conclusion of
ably/realtime#587
/* This is most likely to happen for the delayed xhrs, when xhrs and ws are scheduled in parallel*/
330
330
Logger.logAction(Logger.LOG_MINOR,'ConnectionManager.scheduleTransportActivation()','Current connection state ('+this.state.state+') is not valid to upgrade in; abandoning upgrade');
@@ -355,17 +355,28 @@ var ConnectionManager = (function() {
355
355
if(self.state===self.states.connected)
356
356
self.state=self.states.synchronizing;
357
357
358
+
/* If the connectionId has changed, the upgrade hasn't worked. But as
359
+
* it's still an upgrade, realtime still expects a sync - it just needs to
360
+
* be a sync with the new connectionSerial (which will be -1). (And it
361
+
* needs to be set in the library, which is done by activateTransport). */
Logger.logAction(Logger.LOG_ERROR,'ConnectionManager.scheduleTransportActivation()','Upgrade resulted in new connectionId; resetting library connectionSerial from '+self.connectionSerial+' to '+newConnectionSerial+'; upgrade error was '+error);
367
+
}
368
+
358
369
/* make this the active transport */
359
370
Logger.logAction(Logger.LOG_MINOR,'ConnectionManager.scheduleTransportActivation()','Activating transport; transport = '+transport);
360
371
/* if activateTransport returns that it has not done anything (eg because the connection is closing), don't bother syncing */
Logger.logAction(Logger.LOG_MINOR,'ConnectionManager.scheduleTransportActivation()','sync successful on upgraded transport; transport = '+transport+'; connectionSerial = '+newConnectionSerial+'; connectionId = '+connectionId);
369
380
370
381
Logger.logAction(Logger.LOG_MINOR,'ConnectionManager.scheduleTransportActivation()','Sending queued messages on upgraded transport; transport = '+transport);
371
382
/* Restore pre-sync state. If state has changed in the meantime,
0 commit comments