Skip to content

Commit

Permalink
fix(client): flush resultsBuffer on engine upgrade (karma-runner#3212)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbhartman authored and anthony-redFox committed May 5, 2023
1 parent 5601086 commit 61c19c0
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 61c19c0

Please sign in to comment.