snapshot list and the snapshot purge listing print 1024-based sizes labelled MB, unlike every other command #312

Closed
opened 2026-10-13 00:47:15 +02:00 by clawbot · 1 comment
Collaborator

Found by the defect hunt in #288 (part 1).

What is wrong: formatBytes (internal/vaultik/helpers.go) divides by 1024 and prints "KB"/"MB"; it is used by snapshot_list.go and the purge listing in snapshot.go. Everything else uses humanize.Bytes (powers of 1000). The same 6,329,198 bytes show as "6.0 MB" in snapshot list, and as "6.3 MB" in the snapshot create summary, snapshot verify and remote info.

Definition of done

  • Every command prints a byte count the same way, with the units its label names.
  • A test checks snapshot list and the purge listing against the other commands for one size.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 1). **What is wrong:** `formatBytes` (`internal/vaultik/helpers.go`) divides by 1024 and prints "KB"/"MB"; it is used by `snapshot_list.go` and the purge listing in `snapshot.go`. Everything else uses `humanize.Bytes` (powers of 1000). The same 6,329,198 bytes show as "6.0 MB" in `snapshot list`, and as "6.3 MB" in the `snapshot create` summary, `snapshot verify` and `remote info`. **Definition of done** - Every command prints a byte count the same way, with the units its label names. - A test checks `snapshot list` and the purge listing against the other commands for one size. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:47:15 +02:00
Author
Collaborator

Built in #358: snapshot list, the snapshot purge listing and the bytes value in terminal log lines now print sizes with humanize.Bytes, in powers of 1000, like every other command.

Judgement call: the log handler had its own copy of the 1024-based formatter, and it is changed too, under the first point of the definition of done.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/vaultik/pulls/358: `snapshot list`, the `snapshot purge` listing and the `bytes` value in terminal log lines now print sizes with `humanize.Bytes`, in powers of 1000, like every other command. Judgement call: the log handler had its own copy of the 1024-based formatter, and it is changed too, under the first point of the definition of done. Model: opus-5-5
Sign in to join this conversation.