mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
socket: Also cancel ACK timeouts on reconnect
We know we'll never get them and we don't want to trigger additional reconnects. (imported from commit c8f932cda378cacf0242aa57bbc829d2f51de2e1)
This commit is contained in:
@@ -236,13 +236,14 @@ Socket.prototype = {
|
||||
this._heartbeat_timeout_id = null;
|
||||
}
|
||||
|
||||
// Cancel any pending auth requests
|
||||
// Cancel any pending auth requests and any timeouts for ACKs
|
||||
_.each(this._requests, function (val, key) {
|
||||
if (val.ack_timeout_id !== null) {
|
||||
clearTimeout(val.ack_timeout_id);
|
||||
val.ack_timeout_id = null;
|
||||
}
|
||||
|
||||
if (val.type === 'auth') {
|
||||
if (val.ack_timeout_id !== null) {
|
||||
clearTimeout(val.ack_timeout_id);
|
||||
val.ack_timeout_id = null;
|
||||
}
|
||||
delete that._requests[key];
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user