Skip to content

v0.1.8: UpdateCleanup helper shows progress while clearing .old/.update at startup#12

Merged
StuartMeeks merged 1 commit into
mainfrom
startup-cleanup-progress-message
May 27, 2026
Merged

v0.1.8: UpdateCleanup helper shows progress while clearing .old/.update at startup#12
StuartMeeks merged 1 commit into
mainfrom
startup-cleanup-progress-message

Conversation

@StuartMeeks
Copy link
Copy Markdown
Owner

Problem

Consuming apps call IUpdateInstaller.CleanupOldInstall() at the start of Main to delete the .old/ and .update/ leftovers from a previous update. That call is silent and synchronous, and under OneDrive / antivirus / Windows Search contention the DeleteDirectoryRobustly retry/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 existing UpdateInstaller-pure / UpdateBanner-UI split).

  • IUpdateInstaller.HasPendingCleanup — cheap, side-effect-free property; true when a .old/ or .update/ directory still exists.
  • UpdateCleanup static helper (mirrors UpdateBanner) — Run(IServiceProvider, IAnsiConsole?) drop-in startup entry point plus a Run(IUpdateInstaller, IAnsiConsole) overload. Shows a Cleaning up previous update… Spectre status spinner only when HasPendingCleanup is true.
  • Demo Program.cs and README quick start now call UpdateCleanup.Run(serviceProvider).
  • Tests: HasPendingCleanup cases on the installer + new UpdateCleanupTests.
  • Version 0.1.70.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 to UpdateCleanup.Run(sp) opts into the message.

Tests

dotnet test → 188 passed, 0 failed (9 new).

🤖 Generated with Claude Code

…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>
@StuartMeeks StuartMeeks merged commit 529b7b9 into main May 27, 2026
4 checks passed
@StuartMeeks StuartMeeks deleted the startup-cleanup-progress-message branch May 27, 2026 02:19
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.

1 participant