Skip to content

Add startup update notification - #247

Merged
Widthdom merged 1 commit into
mainfrom
feat/update-notification
Jul 29, 2026
Merged

Add startup update notification#247
Widthdom merged 1 commit into
mainfrom
feat/update-notification

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Check trusted nuget.org registration metadata for a newer listed stable nildiff release on eligible console starts.
  • Cache successful checks for 20 hours and persist a one-hour failure backoff so NuGet outages do not add a two-second delay to every launch.
  • Show three choices: update now, skip this run, or skip until the next release.
  • Run only the fixed dotnet tool update --global nildiff process when the user explicitly chooses update.
  • Centralize user-facing behavior and Windows/macOS/Linux examples in USER_GUIDE.md, with concise references from the other documents.

Behavior and impact

The update phase runs only when stdin, stdout, and stderr are all unredirected. Redirected, piped, and automated runs remain unchanged. Network, JSON, cache, timeout, and updater failures are best effort and cannot fail the requested CLI operation.

3. Skip until next version stores dismissedVersion in the user-local update-check.json. The same release remains suppressed across cache refreshes, while a later release prompts again. Existing clients through 1.22.0 cannot receive this startup behavior; it takes effect from the release containing this change.

Validation

  • dotnet format FolderDiffIL4DotNet.sln --no-restore --verify-no-changes
  • dotnet test FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj --configuration Release --no-restore --nologo
    • 2060 passed
    • 0 failed
    • 1 skipped
  • UpdateNotificationServiceTests: 16 focused tests covering caching, stale refresh, failure backoff, trusted registration pages, all prompt choices, updater outcomes, and ProgramRunner stdout/stderr behavior.

Manual prompt verification

Create the user-local update-check.json with a latestVersion greater than the built application version, dismissedVersion set to null, and nextCheckAtUtc set to a future timestamp no more than 20 hours away. Then launch nildiff directly from an interactive console with all three standard streams unredirected. This exercises the cached path without contacting NuGet and displays choices 1, 2, and 3.

@Widthdom
Widthdom force-pushed the feat/update-notification branch from 7bde4fe to 1ea1e7d Compare July 29, 2026 10:41
@Widthdom
Widthdom force-pushed the feat/update-notification branch from 1ea1e7d to 9663e03 Compare July 29, 2026 11:25
@Widthdom
Widthdom marked this pull request as ready for review July 29, 2026 12:06
@Widthdom
Widthdom merged commit ec64a28 into main Jul 29, 2026
14 checks passed
@Widthdom
Widthdom deleted the feat/update-notification branch July 29, 2026 12:07
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