A database target does not show its archive file, size or last write #397

Closed
opened 2026-10-01 22:06:26 +02:00 by clawbot · 2 comments
Collaborator

Owner's request, #377 (chat, 2026-10-01):

audit the whole app for stupid cases of missing functionality or basic things like this (like the stats panel at the top that i requested).

What is missing: for a database target, the target list shows only its expiry. It does not show which file the archive is written to, how big that file is, or when it was last written. Yet the README's backup instructions and its advice to move the archive file away both depend on knowing the file. In the audit, the archive could only be found from a shell on the host.

#376 changes the archive's file name, and #374 adds a Download button.

Definition of done:

  • Each database target in the target list shows its archive file's name, as 376 names it, its size on disk, and when it was last written. Before the first write it shows "not created yet".
  • These come from the file's metadata, without opening the archive or counting its rows.
  • Tests: before the first event, after one, and after the file has been moved away.

PRIORITY: from the owner's audit request of 1 October (#377), in the tier of #367 to #376.

Model: opus-5-5

Owner's request, https://git.eeqj.de/sneak/webhooker/issues/377 (chat, 2026-10-01): > audit the whole app for stupid cases of missing functionality or basic things like this (like the stats panel at the top that i requested). What is missing: for a `database` target, the target list shows only its expiry. It does not show which file the archive is written to, how big that file is, or when it was last written. Yet the README's backup instructions and its advice to move the archive file away both depend on knowing the file. In the audit, the archive could only be found from a shell on the host. https://git.eeqj.de/sneak/webhooker/issues/376 changes the archive's file name, and https://git.eeqj.de/sneak/webhooker/issues/374 adds a Download button. Definition of done: - Each `database` target in the target list shows its archive file's name, as 376 names it, its size on disk, and when it was last written. Before the first write it shows "not created yet". - These come from the file's metadata, without opening the archive or counting its rows. - Tests: before the first event, after one, and after the file has been moved away. PRIORITY: from the owner's audit request of 1 October (https://git.eeqj.de/sneak/webhooker/issues/377), in the tier of https://git.eeqj.de/sneak/webhooker/issues/367 to https://git.eeqj.de/sneak/webhooker/issues/376. Model: opus-5-5
clawbot self-assigned this 2026-10-01 22:06:26 +02:00
Author
Collaborator

Plan.

  • In the webhook page's target list, each database target shows its archive file's name (as delivery.ArchiveFileName gives it), its size on disk, and when it was last written (relative, with the full UTC time on hover). Before the first write it shows "not created yet".
  • The figures come from the files' metadata only (os.Stat), never opening the archive or counting rows. Size is the database file plus its -wal; last written is the later of the two files' modification times, since a write lands in the -wal first.
  • The handler looks the file up by the same name the archive writer uses, so a renamed webhook or target shows its current file.
  • Tests: before the first event ("not created yet"), after one event (a name, a size above zero and a time), and after the file has been moved away ("not created yet" again).
  • Uses the shared styles from #375; stays inside the target list rows, apart from the targets section's add flow being rebuilt in #463.

Model: opus-5-5

Plan. - In the webhook page's target list, each `database` target shows its archive file's name (as `delivery.ArchiveFileName` gives it), its size on disk, and when it was last written (relative, with the full UTC time on hover). Before the first write it shows "not created yet". - The figures come from the files' metadata only (`os.Stat`), never opening the archive or counting rows. Size is the database file plus its `-wal`; last written is the later of the two files' modification times, since a write lands in the `-wal` first. - The handler looks the file up by the same name the archive writer uses, so a renamed webhook or target shows its current file. - Tests: before the first event ("not created yet"), after one event (a name, a size above zero and a time), and after the file has been moved away ("not created yet" again). - Uses the shared styles from https://git.eeqj.de/sneak/webhooker/issues/375; stays inside the target list rows, apart from the targets section's add flow being rebuilt in https://git.eeqj.de/sneak/webhooker/pulls/463. Model: opus-5-5
Author
Collaborator

Built in #469. Each database target in the webhook page's target list now shows its archive file's name, its size on disk (the file and its -wal together) and when it was last written (relative, with the full UTC time on hover), all read from the files' metadata without opening the archive. Before the first write, and after the file has been moved away, it shows the name followed by "not created yet". The README says the same beside the Download button and the move-the-file-away advice.

  • 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

Built in https://git.eeqj.de/sneak/webhooker/pulls/469. Each `database` target in the webhook page's target list now shows its archive file's name, its size on disk (the file and its `-wal` together) and when it was last written (relative, with the full UTC time on hover), all read from the files' metadata without opening the archive. Before the first write, and after the file has been moved away, it shows the name followed by "not created yet". The README says the same beside the Download button and the move-the-file-away advice. - 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#397