From c782fcc2c3bb596413df1341be54cf86eb89ace5 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Tue, 17 Mar 2026 12:18:31 -0400 Subject: [PATCH] fix: add updater API response logging to diagnose update check failures 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) --- internal/updater/service.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/updater/service.go b/internal/updater/service.go index 1a5daea..59e424d 100644 --- a/internal/updater/service.go +++ b/internal/updater/service.go @@ -98,15 +98,24 @@ func (u *UpdateService) CheckForUpdate() (*UpdateInfo, error) { } 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 { - 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 - 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) } + slog.Info("parsed versions", "count", len(versions), "currentVersion", u.currentVersion) + if len(versions) == 0 { slog.Info("no package versions found") return info, nil