From 045956c469da1af2eeaaf6c8e53ee75627dbc9ff Mon Sep 17 00:00:00 2001 From: Tim Hartman Date: Thu, 15 Nov 2018 12:10:19 -0500 Subject: [PATCH] fix(client): flush resultsBuffer on engine upgrade Fixes #3211 --- client/karma.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/karma.js b/client/karma.js index edefcdb14..04715c059 100644 --- a/client/karma.js +++ b/client/karma.js @@ -288,6 +288,11 @@ function Karma (socket, iframe, opener, navigator, location, document) { socket.on('connect', function () { socket.io.engine.on('upgrade', function () { resultsBufferLimit = 1 + // Flush any results which were buffered before the upgrade to WebSocket protocol. + if (resultsBuffer.length > 0) { + socket.emit('result', resultsBuffer) + resultsBuffer = [] + } }) var info = { name: navigator.userAgent,