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
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:
parent
af629fa373
commit
c782fcc2c3
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user