Skip to content

Run Users session actions on the background worker - #33

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/users-session-worker-a704
Oct 20, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/users-session-worker-a704

Conversation

@JamesLinYJ

Copy link
Copy Markdown
Owner

Summary

Disconnect, log off, and send message were already on the Users page. The identity re-check and the WTS calls still ran on the UI thread inside UserPageState::handle_command. Those calls now go through the existing users worker.

  • The UI thread collects the confirmed selection, shows the existing message or confirmation dialog, and submits the command. When the worker returns a failure, it shows the existing error dialog.
  • Immediately before WTSDisconnectSession, WTSLogoffSession, or WTSSendMessageW, the worker re-queries the session and requires the same UserSessionIdentity (session id, logon time > 0, user, domain). A mismatch is ERROR_INVALID_PARAMETER.
  • Unverified rows stay visible and the buttons and context-menu items stay disabled.
  • Status-bar help for IDM_DISCONNECT (3212), IDM_LOGOFF (3215), and IDM_SENDMESSAGE (3210) is in TextKey and every locale.
  • Options, the process tree, and the open process-filter, startup, disk-history, and process-column work are untouched.

Checks

Ran here, against the x86_64-pc-windows-msvc typecheck target:

  • cargo fmt --all -- --check
  • cargo check --all-targets --locked
  • cargo clippy --all-targets --locked -- -D warnings
  • git diff --check

cargo test and cargo build did not link: this machine has no link.exe. That typecheck is not a Windows device test. CI on Windows is the test run.

Open in Web Open in Cursor 

Disconnect, log off, and send message still confirm on the UI thread, but the identity re-check and WTS calls now run on the users worker. A reused session is reported as a failure, and the three commands have status-bar help in every locale.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T03:34:56.374469Z 8e2759e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

TerminateProcess fails once a process has started exiting, and a zero timeout can miss the process object becoming signaled. Wait briefly after that failure so a descendant that exits on its own is not reported as a partial failure.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@cursor
cursor Bot merged commit 2f54000 into main Oct 20, 2026
3 checks passed
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.

2 participants