From 970a5aec1a554c4b73974220cfdf2954e47ec8d7 Mon Sep 17 00:00:00 2001 From: Michael Jolley Date: Fri, 28 Aug 2026 11:22:44 -0500 Subject: [PATCH] Tidy gallery installer review follow-ups Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b34be394-240f-4bdd-878f-41460bc09c36 --- .../Services/JsonRpcExtensionService.cs | 5 ++--- .../Services/NpmCommandRunner.cs | 11 ++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/JsonRpcExtensionService.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/JsonRpcExtensionService.cs index afc597ecf0..6aa45b3005 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/JsonRpcExtensionService.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/JsonRpcExtensionService.cs @@ -327,10 +327,9 @@ public sealed partial class JsonRpcExtensionService : IExtensionService, IJsExte return []; } - // Start the watcher before scanning so a package installed while the scan runs - // is still observed (the per-directory gate and the already-loaded check make a - // watcher-driven load and a scan-driven load for the same directory idempotent). RecoverStaleGalleryInstallMarkersOnce(); + + // Start the watcher before scanning so installs during the scan are still observed. StartDirectoryWatcher(); var accepted = DiscoverAcceptedManifests(ExtensionsPath); diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/NpmCommandRunner.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/NpmCommandRunner.cs index 15c14119fa..50f5199cc6 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/NpmCommandRunner.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Services/NpmCommandRunner.cs @@ -549,9 +549,14 @@ public sealed class NpmCommandRunner : INpmCommandRunner return true; } - return exception is AggregateException aggregateException - && aggregateException.Flatten().InnerExceptions.Count > 0 - && aggregateException.Flatten().InnerExceptions.All(IsExpectedTerminationException); + if (exception is not AggregateException aggregateException) + { + return false; + } + + var flattenedException = aggregateException.Flatten(); + return flattenedException.InnerExceptions.Count > 0 + && flattenedException.InnerExceptions.All(IsExpectedTerminationException); } private static bool IsReparsePoint(string path)