fix: add updater API response logging to diagnose update check failures
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m3s

Logs the raw API response body and status from Gitea package API,
plus parsed version count and current version comparison. This will
show exactly why updates aren't being detected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell 2026-03-17 12:18:31 -04:00
parent af629fa373
commit c782fcc2c3

View File

@ -98,15 +98,24 @@ func (u *UpdateService) CheckForUpdate() (*UpdateInfo, error) {
} }
defer resp.Body.Close() defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("read package API response: %w", err)
}
slog.Info("package API response", "status", resp.StatusCode, "body", string(body)[:min(len(body), 500)])
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status %d from package API", resp.StatusCode) return nil, fmt.Errorf("unexpected status %d from package API: %s", resp.StatusCode, string(body))
} }
var versions []giteaPackageVersion var versions []giteaPackageVersion
if err := json.NewDecoder(resp.Body).Decode(&versions); err != nil { if err := json.Unmarshal(body, &versions); err != nil {
return nil, fmt.Errorf("decode package versions: %w", err) return nil, fmt.Errorf("decode package versions: %w", err)
} }
slog.Info("parsed versions", "count", len(versions), "currentVersion", u.currentVersion)
if len(versions) == 0 { if len(versions) == 0 {
slog.Info("no package versions found") slog.Info("no package versions found")
return info, nil return info, nil