GUACAMOLE-250: Fix backward seeking - must retreat potentially all the way to frame 0 in search of an absolute state.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/1fcb5f2d Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/1fcb5f2d Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/1fcb5f2d Branch: refs/heads/master Commit: 1fcb5f2d197e47478621b298dbab661708c958a6 Parents: 052bb9b Author: Michael Jumper <[email protected]> Authored: Sat Apr 15 16:29:12 2017 -0700 Committer: Michael Jumper <[email protected]> Committed: Sat Apr 15 17:12:29 2017 -0700 ---------------------------------------------------------------------- .../src/main/webapp/modules/SessionRecording.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/1fcb5f2d/guacamole-common-js/src/main/webapp/modules/SessionRecording.js ---------------------------------------------------------------------- diff --git a/guacamole-common-js/src/main/webapp/modules/SessionRecording.js b/guacamole-common-js/src/main/webapp/modules/SessionRecording.js index 34f8aca..5922f17 100644 --- a/guacamole-common-js/src/main/webapp/modules/SessionRecording.js +++ b/guacamole-common-js/src/main/webapp/modules/SessionRecording.js @@ -205,10 +205,15 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) { var startIndex; // Back up until startIndex represents current state - for (startIndex = index; startIndex > currentFrame; startIndex--) { + for (startIndex = index; startIndex >= 0; startIndex--) { var frame = frames[startIndex]; + // If we've reached the current frame, startIndex represents + // current state by definition + if (startIndex === currentFrame) + break; + // If frame has associated absolute state, make that frame the // current state if (frame.clientState) {
