From 01835dca0f8ad4b654b917c5d6ff3fcb83545612 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Fri, 25 Oct 2013 21:12:42 -0400 Subject: [PATCH] socket: Remove old requests (imported from commit 75bc776e539a2f036ed486e99a6635c38f56cdcb) --- static/js/socket.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/socket.js b/static/js/socket.js index 8f8dc0836c..3c0de2e0d1 100644 --- a/static/js/socket.js +++ b/static/js/socket.js @@ -87,7 +87,8 @@ Socket.prototype = { }; sockjs.onmessage = function Socket__sockjs_onmessage(event) { - var req_info = that._requests[event.data.client_meta.req_id]; + var req_id = event.data.client_meta.req_id; + var req_info = that._requests[req_id]; if (req_info === undefined) { blueslip.error("Got a response for an unknown request"); return; @@ -98,6 +99,7 @@ Socket.prototype = { } else { req_info.error('response', event.data.response); } + delete that._requests[req_id]; }; sockjs.onclose = function Socket__sockjs_onclose() {