What is wrong: when snapshot create stops on a file error, a full temp directory or Ctrl-C between blobs, the blob being packed is never closed or removed. Its vaultik-blob-*.tmp (encrypted data, up to blob_size_limit, 10 GB by default) stays in $TMPDIR, every such run adds one, and nothing removes them later. processPhase (internal/snapshot/scanner.go) returns without discarding the packer's current blob; internal/blob/packer.go creates the file in startNewBlob and removes it only in finalizeCurrentBlob.
How it was shown: a source with a readable 200 kB file and a chmod 000 file: snapshot create exited 1 and left $TMPDIR/vaultik-blob-619287593.tmp (131 kB); a second run left a second one, and a SIGINT run (exit 130) left another.
Definition of done
On any error or cancellation, the in-progress blob's temp file is closed and removed.
A test covers a run that fails part-way and a cancelled run, and checks no vaultik-blob-* file is left.
Model: opus-5-5
Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (parts 1 and 2).
**What is wrong:** when `snapshot create` stops on a file error, a full temp directory or Ctrl-C between blobs, the blob being packed is never closed or removed. Its `vaultik-blob-*.tmp` (encrypted data, up to `blob_size_limit`, 10 GB by default) stays in `$TMPDIR`, every such run adds one, and nothing removes them later. `processPhase` (`internal/snapshot/scanner.go`) returns without discarding the packer's current blob; `internal/blob/packer.go` creates the file in `startNewBlob` and removes it only in `finalizeCurrentBlob`.
**How it was shown:** a source with a readable 200 kB file and a `chmod 000` file: `snapshot create` exited 1 and left `$TMPDIR/vaultik-blob-619287593.tmp` (131 kB); a second run left a second one, and a SIGINT run (exit 130) left another.
**Definition of done**
- On any error or cancellation, the in-progress blob's temp file is closed and removed.
- A test covers a run that fails part-way and a cancelled run, and checks no `vaultik-blob-*` file is left.
Model: opus-5-5
clawbot
self-assigned this 2026-10-13 00:47:09 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found by the defect hunt in #288 (parts 1 and 2).
What is wrong: when
snapshot createstops on a file error, a full temp directory or Ctrl-C between blobs, the blob being packed is never closed or removed. Itsvaultik-blob-*.tmp(encrypted data, up toblob_size_limit, 10 GB by default) stays in$TMPDIR, every such run adds one, and nothing removes them later.processPhase(internal/snapshot/scanner.go) returns without discarding the packer's current blob;internal/blob/packer.gocreates the file instartNewBloband removes it only infinalizeCurrentBlob.How it was shown: a source with a readable 200 kB file and a
chmod 000file:snapshot createexited 1 and left$TMPDIR/vaultik-blob-619287593.tmp(131 kB); a second run left a second one, and a SIGINT run (exit 130) left another.Definition of done
vaultik-blob-*file is left.Model: opus-5-5