Skip to content

Fix deferred telemetry pipe attach for RDP sessions#1992

Merged
tyrielv merged 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-rdp-telemetry-attach
Jun 1, 2026
Merged

Fix deferred telemetry pipe attach for RDP sessions#1992
tyrielv merged 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-rdp-telemetry-attach

Conversation

@tyrielv
Copy link
Copy Markdown
Contributor

@tyrielv tyrielv commented Jun 1, 2026

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 no SessionLogon event fires for already-connected users.

Fix

Enumerate all interactive sessions (Active/Connected, session > 0) via WTSEnumerateSessions and try each until the pipe attaches.

Changes

  • CurrentUser.cs: Add public GetInteractiveSessionIds that filters WTSEnumerateSessions to Active/Connected sessions with ID > 0
  • GVFSService.Windows.cs: Replace single console session check with TryAttachTelemetryPipeForAnySessions that iterates all interactive sessions; move telemetry attacher setup before PendingUpgradeHandler so deferred-upgrade events are buffered
  • Log levels: Downgrade token-query failure from Error to Warning (expected on Cloud PCs where the console session has no user)
  • AOT warnings: Use generic Marshal.SizeOf<T>() and Marshal.PtrToStructure<T>() instead of typeof() overloads

Testing

  • All 818 unit tests pass
  • Verified locally on Cloud PC (RDP-only): telemetry pipe attaches via RDP session after console session fails
  • VFS.Service.PendingUpgradeHandler_Deferred and VFS.Service.PendingUpgradeHandler_Complete confirmed in App Insights

@tyrielv tyrielv force-pushed the tyrielv/fix-rdp-telemetry-attach branch 3 times, most recently from b9531fc to 47f86f8 Compare June 1, 2026 21:01
@tyrielv tyrielv marked this pull request as ready for review June 1, 2026 21:13
@tyrielv tyrielv enabled auto-merge June 1, 2026 21:13
Comment thread GVFS/GVFS.Platform.Windows/CurrentUser.cs Outdated
@tyrielv tyrielv force-pushed the tyrielv/fix-rdp-telemetry-attach branch from 47f86f8 to 4078679 Compare June 1, 2026 23:08
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>
@tyrielv tyrielv force-pushed the tyrielv/fix-rdp-telemetry-attach branch from 4078679 to 291a567 Compare June 1, 2026 23:10
@tyrielv tyrielv merged commit 1ea8abe into microsoft:master Jun 1, 2026
51 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