Show a database target's archive file, size and last write in the target list (closes #397) #469

Merged
clawbot merged 1 commits from issue-397-archive-file-in-target-list into next 2026-10-02 21:22:34 +02:00
Collaborator

Each database target in the webhook page's target list now shows its archive file's name, its size on disk and when it was last written, relative with the full UTC time on hover. Before the first write, and after the file has been moved away, it shows the name followed by "not created yet".

The figures come from the metadata of the archive file and its -wal (delivery.StatArchive); the archive is never opened. The size is the two files together and the last write the later of their modification times, because a write lands in the -wal first. So just after a write the size includes the -wal: one small event shows about 49 kB, which shrinks once the -wal is folded into the file.

The file is found with delivery.ArchivePath, as the archive writer and the Download button find it, so it follows a rename. The list's rows are now TargetRowView: the existing TargetView plus the archive file, nil for other types. Metadata that cannot be read for another reason is logged and shown as "could not be read".

  • Judgement call: the page does not take the rename lock, so a page loaded during a rename can show "not created yet" until reloaded.
  • Judgement call: the last write is the modification time, so folding the -wal into the file, up to about a minute after the last event, moves it to that moment.
  • Rule suppressed: gosec's integer conversion warning on the file size passed to the formatter; a size is never negative.

Model: opus-5-5

Each `database` target in the webhook page's target list now shows its archive file's name, its size on disk and when it was last written, relative with the full UTC time on hover. Before the first write, and after the file has been moved away, it shows the name followed by "not created yet". The figures come from the metadata of the archive file and its `-wal` (`delivery.StatArchive`); the archive is never opened. The size is the two files together and the last write the later of their modification times, because a write lands in the `-wal` first. So just after a write the size includes the `-wal`: one small event shows about 49 kB, which shrinks once the `-wal` is folded into the file. The file is found with `delivery.ArchivePath`, as the archive writer and the Download button find it, so it follows a rename. The list's rows are now `TargetRowView`: the existing `TargetView` plus the archive file, nil for other types. Metadata that cannot be read for another reason is logged and shown as "could not be read". - Judgement call: the page does not take the rename lock, so a page loaded during a rename can show "not created yet" until reloaded. - Judgement call: the last write is the modification time, so folding the `-wal` into the file, up to about a minute after the last event, moves it to that moment. - Rule suppressed: gosec's integer conversion warning on the file size passed to the formatter; a size is never negative. Model: opus-5-5
clawbot added the needs-review label 2026-10-02 21:08:18 +02:00
clawbot self-assigned this 2026-10-02 21:08:18 +02:00
clawbot added 1 commit 2026-10-02 21:08:18 +02:00
Each database target's row on the webhook page names its archive
file, as delivery.ArchivePath finds it, and shows its size on disk and
when it was last written, or "not created yet" when there is no file.
The figures come from the metadata of the file and its -wal only: the
size is the two together, and the last write the later of their
modification times, since a write lands in the -wal first.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 2967c475a1 into next 2026-10-02 21:22:34 +02:00
clawbot deleted branch issue-397-archive-file-in-target-list 2026-10-02 21:22:34 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#469