From 7d9c64487d38ca5e96c385c3b1148ddcf30afbca Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Tue, 27 Oct 2026 21:10:56 -0400 Subject: [PATCH] fix(update): check for updates one minute after startup The first background check waited the full 30-minute interval, so sessions shorter than that never checked or downloaded an update. Co-Authored-By: Claude Opus 5.5 --- OpenNest/UpdaterService.cs | 5 ++++- docs/auto-update.md | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenNest/UpdaterService.cs b/OpenNest/UpdaterService.cs index 71fdeb0a..ec721db2 100644 --- a/OpenNest/UpdaterService.cs +++ b/OpenNest/UpdaterService.cs @@ -25,6 +25,9 @@ namespace OpenNest /// public sealed class UpdaterService : IDisposable { + // Short first delay: most sessions are far shorter than the interval and + // would otherwise never check; the delay keeps the check off startup. + private static readonly TimeSpan FirstCheckDelay = TimeSpan.FromMinutes(1); private static readonly TimeSpan CheckInterval = TimeSpan.FromMinutes(30); private const string GitHubRepositoryUrl = "https://github.com/ajisaacs/OpenNest"; @@ -103,7 +106,7 @@ namespace OpenNest if (_manager is null || !_manager.IsInstalled) return; - _timer = new Timer(_ => _ = TickAsync(), null, CheckInterval, CheckInterval); + _timer = new Timer(_ => _ = TickAsync(), null, FirstCheckDelay, CheckInterval); } /// Applies the downloaded update and restarts the process. Call only after the user agrees. diff --git a/docs/auto-update.md b/docs/auto-update.md index 87c44ca9..04762db3 100644 --- a/docs/auto-update.md +++ b/docs/auto-update.md @@ -2,7 +2,7 @@ The Windows desktop app (`OpenNest.exe`) can self-update via [Velopack](https://velopack.io): `OpenNest.UpdaterService` checks its update -source 30 minutes after startup and every 30 minutes after that, and downloads +source one minute after startup and every 30 minutes after that, and downloads a newer release in the background. Once a download finishes, a clickable status-bar item offers to restart into it; nothing restarts without that confirmation, so an open, unsaved nest is never discarded automatically. @@ -11,7 +11,7 @@ A download the user does not restart for is applied the next time OpenNest starts: `VelopackApp.Build().Run()` in `MainApp` keeps Velopack's default `SetAutoApplyOnStartup(true)`, so launching after a download opens the new version. Nothing runs while OpenNest is closed (no service or scheduled task), -and a session shorter than the first 30 minutes never checks. +and a session shorter than the first minute never checks. **Help > Check for Updates** runs the same check immediately (waiting for a background check already in progress rather than starting a second one) and