When a library opens, it deletes every .quak-*.tmp file in the cache's originals/ and thumbnails/ directories (src/library/content.ts:656-668). It does this even when another process is still writing that file. The download writer's temporary names carry no process ID (src/download/index.ts:205). The README allows several processes on one cache ("no lock file").
Example: quak backup runs for hours. Meanwhile quak get 123 in another terminal opens the same default cache and deletes the backup's partly written download. The backup's rename then fails with ENOENT, and that file is recorded as failed for the run. The backup tree already avoids this for its own temporary files by putting the process ID in the name and deleting only those whose process has exited (src/backup.ts:163-212).
Definition of done
The download writer's temporary names carry the process ID, and the cache deletes a leftover only when its process is no longer running. Use the same rule as removeLeftoverTempFiles in src/backup.ts, shared rather than copied.
The README backup-layout paragraph that names the temporary files is updated.
Tests: a temporary file carrying a live process ID survives open(), and one carrying a process ID that has exited is removed.
make check green; TODO.md updated in the same commit.
Model: opus-5-5
## Problem
When a library opens, it deletes every `.quak-*.tmp` file in the cache's `originals/` and `thumbnails/` directories (`src/library/content.ts:656-668`). It does this even when another process is still writing that file. The download writer's temporary names carry no process ID (`src/download/index.ts:205`). The README allows several processes on one cache ("no lock file").
Example: `quak backup` runs for hours. Meanwhile `quak get 123` in another terminal opens the same default cache and deletes the backup's partly written download. The backup's rename then fails with `ENOENT`, and that file is recorded as failed for the run. The backup tree already avoids this for its own temporary files by putting the process ID in the name and deleting only those whose process has exited (`src/backup.ts:163-212`).
## Definition of done
1. The download writer's temporary names carry the process ID, and the cache deletes a leftover only when its process is no longer running. Use the same rule as `removeLeftoverTempFiles` in `src/backup.ts`, shared rather than copied.
2. The README backup-layout paragraph that names the temporary files is updated.
3. Tests: a temporary file carrying a live process ID survives `open()`, and one carrying a process ID that has exited is removed.
4. `make check` green; `TODO.md` updated in the same commit.
Model: opus-5-5
clawbot
self-assigned this 2026-09-23 05:34:58 +02:00
Implemented in #120: the download writer's temp names carry the process ID, and the cache and the backup share one rule that deletes a temp file only when its process has exited.
Model: opus-5-5
Implemented in https://git.eeqj.de/sneak/quak/pulls/120: the download writer's temp names carry the process ID, and the cache and the backup share one rule that deletes a temp file only when its process has exited.
Model: opus-5-5
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.
Problem
When a library opens, it deletes every
.quak-*.tmpfile in the cache'soriginals/andthumbnails/directories (src/library/content.ts:656-668). It does this even when another process is still writing that file. The download writer's temporary names carry no process ID (src/download/index.ts:205). The README allows several processes on one cache ("no lock file").Example:
quak backupruns for hours. Meanwhilequak get 123in another terminal opens the same default cache and deletes the backup's partly written download. The backup's rename then fails withENOENT, and that file is recorded as failed for the run. The backup tree already avoids this for its own temporary files by putting the process ID in the name and deleting only those whose process has exited (src/backup.ts:163-212).Definition of done
removeLeftoverTempFilesinsrc/backup.ts, shared rather than copied.open(), and one carrying a process ID that has exited is removed.make checkgreen;TODO.mdupdated in the same commit.Model: opus-5-5
Implemented in #120: the download writer's temp names carry the process ID, and the cache and the backup share one rule that deletes a temp file only when its process has exited.
Model: opus-5-5