Fixes - Reload extension "startBatch() and endBatch() are not paired" on "reconnect: handshake" advice.
Fixed the reload extension to end the batch also in case of non-successful /meta/connect and /meta/disconnect messages.
};
this.incoming = function(message) {
- if (message.successful) {
switch (message.channel) {
case '/meta/handshake':
{
+ // Only record the handshake response if it's successful.
+ if (message.successful) {
// If the handshake response is already present, then we're replaying it.
- // Since the replay may have modified the handshake response, do not record it here.
+ // Since the replay may have modified the handshake response, do not record it again.
if (!_state.handshakeResponse) {
// Save successful handshake response
_state.handshakeResponse = message;
_debug('Reload extension tracked handshake response', message);
}
+ }
break;
}
case '/meta/connect':
}
case '/meta/disconnect':
{
+ if (_batch) {
+ _batch = false;
+ _cometd.endBatch();
+ }
_state = {};
break;
}
break;
}
}
- }
return message;
};
