Skip to content

shell: Make idle timeouts more robust#22924

Closed
mvollmer wants to merge 2 commits intocockpit-project:mainfrom
mvollmer:shell-real-time-idle-timeouts
Closed

shell: Make idle timeouts more robust#22924
mvollmer wants to merge 2 commits intocockpit-project:mainfrom
mvollmer:shell-real-time-idle-timeouts

Conversation

@mvollmer
Copy link
Member

@mvollmer mvollmer commented Feb 25, 2026

No description provided.

@mvollmer
Copy link
Member Author

The first commit "shell: Look at the wall clock to measure session idle time" might be all that we need.

Counting timer ticks works only when the ticks come on time. Usually
they do, but browsers might decide to not run our JavaScript for
whatever reason, especially if the tab is actually idle or minimized
or otherwise hidden.

By looking at the wall clock time, the session gets logged out
immediately once the timer ticks start coming again (and it has indeed
been idle long enough).

See https://issues.redhat.com/browse/COCKPIT-1418
@mvollmer mvollmer force-pushed the shell-real-time-idle-timeouts branch 2 times, most recently from 40c35b7 to 8477f6a Compare February 25, 2026 14:35
and use it as a backup for the JavaScript session timeout
implementation. With it, the session really ends at about the expected
time, regardless of whether JavaScript is executed by the browser or
not.

We keep the JavaScript implementation so that session timeouts work
with older cockpit-ws versions and to keep the cockpit-ws side
simple. There anyway needs to be cooperation from JavaScript to
perform a proper logout.
@mvollmer mvollmer closed this Feb 26, 2026
@mvollmer mvollmer force-pushed the shell-real-time-idle-timeouts branch from 8477f6a to 3b150d1 Compare February 26, 2026 08:19
@mvollmer
Copy link
Member Author

Uh, how did I close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant