fix(resume): silent SaveResumeState failures during download lose progress #143

Closed
opened 2026-07-13 18:16:03 +00:00 by the.auditor · 1 comment
Owner

internal/downloader/download.go:257,265SaveResumeState errors are discarded with _ =. If writing the .pget metadata file fails (disk full, permissions), the download continues but resume state is lost. On interruption, user can't resume.

Suggestion: log a warning when state save fails, but don't abort (download can still complete).

if resume {
    if err := SaveResumeState(state, filePath); err != nil {
        log.Printf("warning: failed to save resume state: %v", err)
    }
}

Discovered during review of PR #142.

`internal/downloader/download.go:257,265` — `SaveResumeState` errors are discarded with `_ =`. If writing the `.pget` metadata file fails (disk full, permissions), the download continues but resume state is lost. On interruption, user can't resume. Suggestion: log a warning when state save fails, but don't abort (download can still complete). ```go if resume { if err := SaveResumeState(state, filePath); err != nil { log.Printf("warning: failed to save resume state: %v", err) } } ``` Discovered during review of PR #142.
Owner

Closing — implemented in PR #165. SaveResumeState errors now log a warning instead of being silently discarded.

Closing — implemented in PR #[165](https://git.lan.thwap.org/thwap/pget/pulls/165). SaveResumeState errors now log a warning instead of being silently discarded.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/pget#143
No description provided.