From e44ca944fe94ae455cd6dc45d9985a6d9fb94754 Mon Sep 17 00:00:00 2001 From: Tim Hartman Date: Wed, 29 Apr 2020 16:18:33 -0400 Subject: [PATCH] fix(client): flush resultsBuffer on engine upgrade (#3212) 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,