From 27c7ab782ffe95dd7d7d23d0705d22ea90969b2a Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 2 Mar 2022 17:34:35 +0000 Subject: [PATCH] GUACAMOLE-462: Do not continue an outstanding state import if its corresponding seek has been cancelled. --- .../src/main/webapp/modules/SessionRecording.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/SessionRecording.js b/guacamole-common-js/src/main/webapp/modules/SessionRecording.js index 8512c58dd..9836355d4 100644 --- a/guacamole-common-js/src/main/webapp/modules/SessionRecording.js +++ b/guacamole-common-js/src/main/webapp/modules/SessionRecording.js @@ -607,8 +607,14 @@ Guacamole.SessionRecording = function SessionRecording(source) { // current state if (frame.clientState) { frame.clientState.text().then(function textReady(text) { + + // Cancel seek if aborted + if (thisSeek.aborted) + return; + playbackClient.importState(JSON.parse(text)); currentFrame = index; + }); break; } @@ -629,7 +635,7 @@ Guacamole.SessionRecording = function SessionRecording(source) { return; // If frames remain, replay the next frame - if (!thisSeek.aborted && currentFrame < index) + if (currentFrame < index) replayFrame(currentFrame + 1, continueReplay); // Otherwise, the seek operation is completed