v0.1.8: UpdateCleanup helper shows progress while clearing .old/.update at startup#12
Merged
Merged
Conversation
…te at startup Startup CleanupOldInstall() is synchronous and, under OneDrive / antivirus / Windows Search contention, the DeleteDirectoryRobustly retry/backoff path can take seconds with no output — the app looks hung. - Add IUpdateInstaller.HasPendingCleanup: cheap, side-effect-free check that is true when a .old/ or .update/ directory left by a previous update still exists. - Add static UpdateCleanup helper (mirrors UpdateBanner). UpdateCleanup.Run shows a "Cleaning up previous update…" status spinner only when HasPendingCleanup is true; otherwise it cleans silently. Run(IServiceProvider, IAnsiConsole?) is the drop-in startup entry point; Run(IUpdateInstaller, IAnsiConsole) is for explicit callers. The installer pipeline stays console-free; UI stays in the UI layer. - Demo Program.cs and README quick start now call UpdateCleanup.Run(serviceProvider). - Tests: HasPendingCleanup cases + new UpdateCleanupTests. Purely additive — CleanupOldInstall() is unchanged, so existing consumers keep compiling; switching the one startup line opts into the message. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Problem
Consuming apps call
IUpdateInstaller.CleanupOldInstall()at the start ofMainto delete the.old/and.update/leftovers from a previous update. That call is silent and synchronous, and under OneDrive / antivirus / Windows Search contention theDeleteDirectoryRobustlyretry/backoff path can take several seconds — with no output the app appears to hang.Change
Show a "cleaning up" message while the delete runs, but only when there is something to clean (either
.old/or.update/exists); silent otherwise. The message is the library's responsibility, kept in the UI layer so the installer pipeline stays console-free (consistent with the existingUpdateInstaller-pure /UpdateBanner-UI split).IUpdateInstaller.HasPendingCleanup— cheap, side-effect-free property;truewhen a.old/or.update/directory still exists.UpdateCleanupstatic helper (mirrorsUpdateBanner) —Run(IServiceProvider, IAnsiConsole?)drop-in startup entry point plus aRun(IUpdateInstaller, IAnsiConsole)overload. Shows aCleaning up previous update…Spectre status spinner only whenHasPendingCleanupistrue.Program.csand README quick start now callUpdateCleanup.Run(serviceProvider).HasPendingCleanupcases on the installer + newUpdateCleanupTests.0.1.7→0.1.8, changelog entry added.Compatibility
Purely additive — not a breaking change.
CleanupOldInstall()is untouched, so existing consumers (incl. pl-app) keep compiling; switching the one startup line toUpdateCleanup.Run(sp)opts into the message.Tests
dotnet test→ 188 passed, 0 failed (9 new).🤖 Generated with Claude Code