mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
socket: Ensure the SockJS object is closed when reconnecting
Without an explicit close, we will continue to get messages on the old connection, even once we replace the _sockjs property. This leads to "impossible" situations, such as receiving ACKs after reconnecting. (imported from commit f8927fdf0551610e5b9d1db29bba00e160e76b6d)
This commit is contained in:
@@ -231,6 +231,7 @@ Socket.prototype = {
|
||||
this._is_authenticated = false;
|
||||
this._is_reconnecting = true;
|
||||
this._reconnect_initiation_time = now;
|
||||
this._sockjs.close();
|
||||
|
||||
this._reconnect_timeout_id = setTimeout(function () {
|
||||
that._reconnect_timeout_id = null;
|
||||
|
||||
Reference in New Issue
Block a user