[v3] updater: CheckInterval re-downloads the whole artifact on every tick while an update is staged (StateReady)
Wails version family
v3
Exact Wails version
v3.0.0-beta.26 (pkg/updater; updater.go is identical on master)
Operating System
All
Description
With Config.CheckInterval set, every tick downloads the whole artifact again, even when an update is already downloaded, verified and waiting for Restart (StateReady). periodicCheckLoop only skips the tick while checking, downloading, verifying or installing:
s := u.State()
if s == StateChecking || s == StateDownloading || s == StateVerifying || s == StateInstalling {
continue
}
_ = u.CheckAndInstall(u.periodicCtx)StateReady is not skipped, so CheckAndInstall runs again and re-downloads the same release. Users who postpone the restart for hours download the full release once per interval.
To Reproduce
CheckInterval: 2 * time.Second, with a 14.6 MB artifact on a local endpoint feed.- Let the first check stage the update, and don't call
Restart. - The feed server logs a full artifact download on every tick.
Expected behaviour
While an update for the same version is staged (StateReady), the periodic check skips the download. It could still check for a newer version and download only if the version differs.
Attempted Fixes
We leave CheckInterval at 0 and run our own timer that calls Check, then DownloadAndInstall only once per version.
System Details
Windows 11 Pro 26200 (x64), Go 1.26.0, CGO_ENABLED=0, github.com/wailsapp/wails/v3 v3.0.0-beta.26. wails3 doctor was not run: the test app is built with plain go build.
Additional context
Also, the Config.Window comment says "Not yet wired in v1 of the package", but a nil Window does open the built-in window from CheckAndInstall and from periodic checks.
Source: wailsapp/wails