mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	socket: Cancel pending auth requests on reconnect
(imported from commit 02ea7c1592ef48e2596a0dfd4830c2307a3e7df4)
This commit is contained in:
		@@ -227,6 +227,17 @@ Socket.prototype = {
 | 
			
		||||
            this._heartbeat_timeout_id = null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Cancel any pending auth requests
 | 
			
		||||
        _.each(this._requests, function (val, key) {
 | 
			
		||||
            if (val.type === 'auth') {
 | 
			
		||||
                if (val.ack_timeout_id !== null) {
 | 
			
		||||
                    clearTimeout(val.ack_timeout_id);
 | 
			
		||||
                    val.ack_timeout_id = null;
 | 
			
		||||
                }
 | 
			
		||||
                delete that._requests[key];
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        this._is_open = false;
 | 
			
		||||
        this._is_authenticated = false;
 | 
			
		||||
        this._is_reconnecting = true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user