Skip to content

release: 1.2.0 — suppress post-run banner after update (#42) - #43

Merged
StuartMeeks merged 1 commit into
mainfrom
fix/42-suppress-banner-after-update
Oct 20, 2026
Merged

StuartMeeks merged 1 commit into
mainfrom
fix/42-suppress-banner-after-update

Conversation

@StuartMeeks

Copy link
Copy Markdown
Owner

Closes #42.

Problem

UpdateBanner.RenderIfAvailable compared the latest tag with the running process's version. After update installs, the process is still the old binary, so the banner offered the version just installed. It also repeated update check and a declined update.

Fix

  • Internal process-wide UpdateSession marker:
    • UpdateCommand / UpdateCheckCommand mark it once they have shown "Latest release: …" (install, decline, failure, up to date).
    • UpdateInstaller records the installed tag after a successful swap, which covers apps calling ISelfUpdater.InstallAsync from their own command.
  • RenderIfAvailable returns early (before waiting on the task) when the marker is set, and stays silent when the available release is not newer than the installed one.
  • New public UpdateBanner.Suppress() (XML-documented) for apps with their own update UX.

Tests

New banner, command and installer tests. On both TFMs they fail with the fix removed and pass with it. Static state is isolated per test through an internal AsyncLocal test scope (UpdateSession.BeginTestScope()) rather than a non-parallel collection. Only tests that assert on the marker open a scope, so tests that write it, such as the installer tests, need no coordination.

Release

  • Version 1.1.0 → 1.2.0 (additive API, so minor).
  • PackageValidationBaselineVersion 1.0.1 → 1.1.0 (the last shipped release, restorable on nuget.org).
  • CHANGELOG [1.2.0] and README note.

Locally: Release build clean, pack/validation passes, 426/426 tests on net8.0 + net10.0.

🤖 Generated with Claude Code

The post-run banner compared the latest tag with the running process's
version, which is still the old binary after an install swaps the files,
so right after `update` it offered the version just installed. It also
repeated `update check` and a declined `update`.

An internal process-wide UpdateSession now records that the update UX has
shown the latest release (set by UpdateCommand and UpdateCheckCommand) and
which tag this process installed (set by UpdateInstaller on success).
RenderIfAvailable is a no-op in either case. New public
UpdateBanner.Suppress() lets apps with their own update UX do the same.

Tests isolate the static state per test via an AsyncLocal test scope
rather than a serial collection, so writers such as the installer tests
need no coordination.

Version 1.2.0; PackageValidationBaselineVersion moves to 1.1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StuartMeeks
StuartMeeks merged commit 2d65633 into main Oct 20, 2026
9 checks passed
@StuartMeeks
StuartMeeks deleted the fix/42-suppress-banner-after-update branch October 20, 2026 01:15
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.

Post-run update banner shows after update (and update check), offering the version just installed

1 participant