Skip to content

Fix client_idle_timeout enforcement for desktop sessions#55693

Merged
zmb3 merged 1 commit intomasterfrom
zmb3/desktop-client-idle
Jun 24, 2025
Merged

Fix client_idle_timeout enforcement for desktop sessions#55693
zmb3 merged 1 commit intomasterfrom
zmb3/desktop-client-idle

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Jun 12, 2025

We had been updating the client activity tracker any time a message was sent from the client (browser or Teleport Connect) to the remote host. This approach was fine for the original RDP implementation, as all messages sent in this direction were for user input (keypresses, mouse movement, scroll wheel, etc), but it is insufficient with the current RemoteFX implementation as there are some messages sent by the remote Windows hosts which require client acknowledgements. These acknowledgements were mistakenly being counted as client activity.

Changelog: fixed an issue that could prevent Windows desktop sessions from terminating when the idle timeout was exceeded.

Closes #55691

We had been updating the client activity tracker any time a message
was sent from the client (browser or Teleport Connect) to the remote
host. This approach was fine for the original RDP implmentation, as
all messages sent in this direction were for user input (keypresses,
mouse movement, scroll wheel, etc), but it is insufficient with the
current RemoteFX implementation as there are some messages sent by
the remote Windows hosts which require client acknowledgements.
These acknowledgements were mistakenly being counted as client activity.

Closes #55691
// because we don't want a session to be closed due to inactivity during a large
// file transfer.
switch msg.(type) {
case tdp.KeyboardButton, tdp.MouseMove, tdp.MouseButton, tdp.MouseWheel,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to include tdp.SyncKeys here as well. And tdp.ClipboardData maybe?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clipboard data happens on copy or paste, and this would require keypresses or clicks, so I decided not to include them since they'd happen around the same time as other interactive messages.

Similar story for tdp.SyncKeys it happens in the handleKeyboardEvent, so tdp.KeyboardButton messages will be coming right around the same time.

@zmb3 zmb3 added this pull request to the merge queue Jun 24, 2025
Merged via the queue into master with commit b19999e Jun 24, 2025
48 of 53 checks passed
@zmb3 zmb3 deleted the zmb3/desktop-client-idle branch June 24, 2025 17:54
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@zmb3 See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Failed
branch/v18 Create PR

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client idle timeouts > 1m are not correctly applied for Windows sessions

3 participants