add 'reconnect' setting and patch noVNC to fix issue after browser tab has been idle. #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
explanation for reviewers:
The behavior of an idle tab has not changed by default. After being idle (for about 20 min.), kasm disconnects and shows a blue background.
But instead of running into a javascript error, it now correctly opens the kasm control bar, that allows to reconnect to the session (using the 'Connect' button):
this is still the default behavior (and preferred, so that a 'forgotten' tab does not eat resources for too long).
I've added an option "Automically reconnect", that makes use of the "reconnect" feature of kasm/noVNC. This automically reconnects to the session when it's closed either unexpected, or after idling for too long.
Technicals:
The main issue (kasm disconnects after a while, rendering a blue screen and the error
Uncaught TypeError: Cannot read properties of undefined
) is fixed by clearing the timer interval that kasm added when a disconnect happens. (this timer interval accesses "UI.rfb", but that is set to undefined when disconnected and causes a javascript error).We clear the timer now, so that this error does not occur, and the intended logic of kasm/noVNC runs. (show a "disconnected message" and move the status to "disconnected" so that the kasm control bar opens)
Also added 'noVNC_hidden' css class to the reconnect options in kasm control bar, as this is now controlled from StartOS.