Fix deferred telemetry pipe attach for RDP sessions#1992
Merged
tyrielv merged 1 commit intoJun 1, 2026
Conversation
b9531fc to
47f86f8
Compare
47f86f8 to
4078679
Compare
At startup, the deferred telemetry attacher only checked the physical console session via WTSGetActiveConsoleSessionId. On Cloud PCs and RDP-only machines, the console session has no logged-in user — the real user is in an RDP session. This meant the startup attach always failed, and the retry timer could never succeed either (SYSTEM has no git global config). A SessionLogon event would fix it, but that only fires for NEW logins — not when the service restarts while a user is already connected. Enumerate all interactive sessions (Active/Connected, session > 0) via WTSEnumerateSessions and try each until the pipe attaches. Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
4078679 to
291a567
Compare
KeithIsSleeping
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
At startup, the deferred telemetry attacher only checked the physical console session via
WTSGetActiveConsoleSessionId. On Cloud PCs and RDP-only machines, the console session has no logged-in user — the real user is in an RDP session. This meant the startup attach always failed, the retry timer could never succeed (SYSTEM has no git global config), and noSessionLogonevent fires for already-connected users.Fix
Enumerate all interactive sessions (Active/Connected, session > 0) via
WTSEnumerateSessionsand try each until the pipe attaches.Changes
CurrentUser.cs: Add publicGetInteractiveSessionIdsthat filtersWTSEnumerateSessionsto Active/Connected sessions with ID > 0GVFSService.Windows.cs: Replace single console session check withTryAttachTelemetryPipeForAnySessionsthat iterates all interactive sessions; move telemetry attacher setup beforePendingUpgradeHandlerso deferred-upgrade events are bufferedMarshal.SizeOf<T>()andMarshal.PtrToStructure<T>()instead oftypeof()overloadsTesting
VFS.Service.PendingUpgradeHandler_DeferredandVFS.Service.PendingUpgradeHandler_Completeconfirmed in App Insights