Skip to content

Commit

Permalink
fix(client): flush resultsBuffer on engine upgrade (#3212)
Browse files Browse the repository at this point in the history
Fixes #3211
  • Loading branch information
tbhartman authored Apr 29, 2020
1 parent f9ef33a commit e44ca94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e44ca94

Please sign in to comment.