feat: Integrate IProcessInfoProvider IPC into core workflow#413
Merged
Conversation
Replace Environments (encrypted file) IPC with AutoProcessInfoProvider (NamedPipe > SharedMemory > EncryptedFile auto-fallback) for all ProcessInfo transfer paths: - ClientUpdateStrategy: send ProcessInfo via AutoProcessInfoProvider after building it, providing zero-file-residue IPC for the upgrade path - SilentPollOrchestrator: replace Environments.SetEnvironmentVariable with AutoProcessInfoProvider.SendAsync in OnProcessExit - GeneralUpdateBootstrap.InitializeFromEnvironment: replace Environments.GetEnvironmentVariable with ReceiveAsync Closes #408
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates the IProcessInfoProvider IPC abstraction into the main client→upgrade workflow by replacing the legacy Environments (temp-file) transport for ProcessInfo with AutoProcessInfoProvider (NamedPipe → SharedMemory → EncryptedFile fallback).
Changes:
ClientUpdateStrategynow buildsProcessInfoand attempts to send it viaAutoProcessInfoProvider.SendAsync().SilentPollOrchestratorstores a preparedProcessInfoand sends it via IPC on process exit instead of writing toEnvironments.GeneralUpdateBootstrap.InitializeFromEnvironment()now attempts to receiveProcessInfoviaAutoProcessInfoProvider.ReceiveAsync().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/c#/GeneralUpdate.Core/Strategy/ClientUpdateStrategy.cs | Sends ProcessInfo via IPC after building it. |
| src/c#/GeneralUpdate.Core/Silent/SilentPollOrchestrator.cs | Switches process-exit ProcessInfo handoff from Environments to IPC. |
| src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs | Receives ProcessInfo via IPC during bootstrap initialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+183
to
+185
| // Wire ProcessInfo via IPC (NamedPipe > SharedMemory > EncryptedFile) | ||
| await new AutoProcessInfoProvider().SendAsync(processInfo).ConfigureAwait(false); | ||
| GeneralTracer.Info("ClientUpdateStrategy: ProcessInfo sent via IPC (AutoProcessInfoProvider)."); |
Comment on lines
+183
to
+185
| // Wire ProcessInfo via IPC (NamedPipe > SharedMemory > EncryptedFile) | ||
| await new AutoProcessInfoProvider().SendAsync(processInfo).ConfigureAwait(false); | ||
| GeneralTracer.Info("ClientUpdateStrategy: ProcessInfo sent via IPC (AutoProcessInfoProvider)."); |
Comment on lines
+323
to
+327
| // Send ProcessInfo via IPC — the upgrade process connects as client | ||
| if (_preparedProcessInfo != null) | ||
| { | ||
| new AutoProcessInfoProvider().SendAsync(_preparedProcessInfo).GetAwaiter().GetResult(); | ||
| GeneralTracer.Info("SilentPollOrchestrator: ProcessInfo sent via IPC."); |
Comment on lines
260
to
264
| // Read ProcessInfo via IPC (NamedPipe > SharedMemory > EncryptedFile auto-fallback). | ||
| // Sync wait is acceptable here — the constructor runs once and the | ||
| // IPC providers use short timeouts (5s NamedPipe, immediate MMF/file). | ||
| var processInfo = new AutoProcessInfoProvider().ReceiveAsync().GetAwaiter().GetResult(); | ||
| if (processInfo == null) return; |
Prevent indefinite blocking when no upgrade process connects: - ClientUpdateStrategy: 3s NamedPipe timeout, auto-falls back to SharedMemory/EncryptedFile (normal client flow has no separate upgrade process) - SilentPollOrchestrator.OnProcessExit: 5s NamedPipe timeout with SharedMemory/EncryptedFile auto-fallback for timing gaps Related #408
…Memory/Auto Per review feedback: EncryptedFile is the simplest and most reliable cross-platform IPC mechanism. Remove NamedPipe (connection timing issues), SharedMemory (platform-specific quirks), and Auto (fallback complexity). Changes: - IProcessInfoProvider.cs: retain only interface + EncryptedFileProcessInfoProvider - All call sites use EncryptedFileProcessInfoProvider directly - Remove CancellationToken timeouts (EncryptedFile is synchronous) Related #408
Replace all .ReceiveAsync().GetAwaiter().GetResult() and .SendAsync().GetAwaiter().GetResult() with direct sync calls. - Add Send() / Receive() sync methods to EncryptedFileProcessInfoProvider - GeneralUpdateBootstrap: use Receive() instead of ReceiveAsync().GetAwaiter() - SilentPollOrchestrator: use Send() instead of SendAsync().GetAwaiter() - ClientUpdateStrategy: use Send() instead of await SendAsync() Related #408
Remove tests referencing deleted providers: - NamedPipeProvider_DetectsTimeout - SharedMemoryProvider_RoundTrip - SharedMemoryProvider_ReceiveWithoutSend_ReturnsNull - AutoProvider_FallsBackToEncryptedFile - AutoProvider_ThrowsWhenAllFail Replaced with EncryptedFileIpcTests covering: - Send/Receive roundtrip - Receive without send returns null - Data confidentiality and single-read guarantee - Async API delegates to sync Related #408
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.
Summary
Replaces \Environments\ (encrypted file) IPC with \AutoProcessInfoProvider\ (NamedPipe > SharedMemory > EncryptedFile auto-fallback) for all ProcessInfo transfer paths.
Changes
Benefits
Closes #408