fetch prints a progress line for every 32 KiB it downloads #206

Open
opened 2026-10-13 19:19:39 +02:00 by clawbot · 1 comment
Collaborator

mfer fetch writes one log line per write to the file it is downloading. progressWriter.Write in internal/cli/fetch.go sends a DownloadProgress on every call, one per 32 KiB chunk io.Copy hands it, and reportDownloadProgress logs each one it receives with log.Infof; only a full progress channel drops any. gen, check and freshen send a progress update at most once per second (scanProgressTracker.forward in mfer/scanner.go, Checker.Check in mfer/checker.go, freshenHasher.reportProgress in internal/cli/freshen.go).

Reproduce on next (61238e4): serve a directory holding a 20 MiB file and its index.mf over HTTP; mfer fetch --dest dl http://127.0.0.1:PORT/tree/ prints 602 lines of big.bin: N MiB/20 MiB, ... for the one file, downloaded in 0.1 s. A 1 GiB file gives about 32,000 lines.

Severity: minor. The download is right; its output is unreadable, fills any log that captures it, and -q is the only way out.

Correct: at most one progress update per second per file, plus the one that reports the file complete, as the other commands do.

Definition of done

  • Failing test first: downloading a file of many chunks within one second produces no more than two progress updates, collected as TestFetchProgress collects them.
  • The fix in internal/cli/fetch.go.
  • make check passes.

Model: fable-5-1

`mfer fetch` writes one log line per write to the file it is downloading. `progressWriter.Write` in `internal/cli/fetch.go` sends a `DownloadProgress` on every call, one per 32 KiB chunk `io.Copy` hands it, and `reportDownloadProgress` logs each one it receives with `log.Infof`; only a full progress channel drops any. `gen`, `check` and `freshen` send a progress update at most once per second (`scanProgressTracker.forward` in `mfer/scanner.go`, `Checker.Check` in `mfer/checker.go`, `freshenHasher.reportProgress` in `internal/cli/freshen.go`). Reproduce on `next` (61238e4): serve a directory holding a 20 MiB file and its `index.mf` over HTTP; `mfer fetch --dest dl http://127.0.0.1:PORT/tree/` prints 602 lines of `big.bin: N MiB/20 MiB, ...` for the one file, downloaded in 0.1 s. A 1 GiB file gives about 32,000 lines. Severity: minor. The download is right; its output is unreadable, fills any log that captures it, and `-q` is the only way out. Correct: at most one progress update per second per file, plus the one that reports the file complete, as the other commands do. ## Definition of done - Failing test first: downloading a file of many chunks within one second produces no more than two progress updates, collected as `TestFetchProgress` collects them. - The fix in `internal/cli/fetch.go`. - `make check` passes. Model: fable-5-1
clawbot self-assigned this 2026-10-13 19:19:39 +02:00
Author
Collaborator

Fix in #215: fetch now sends at most one progress update per second per file, plus one when the file completes.

Model: opus-5-5

Fix in https://git.eeqj.de/sneak/mfer/pulls/215: `fetch` now sends at most one progress update per second per file, plus one when the file completes. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#206