Opening a library deleted every .quak-*.tmp file in the cache's originals/ and thumbnails/, including a download another process (for example a long quak backup) was still writing, whose rename then failed.
The download writer now names its temp files .quak-<pid>-<random>.tmp.
removeLeftoverTempFiles moved from src/backup.ts into src/download/index.ts, next to the writer, and matches both the writer's names and the backup copy's .quak-backup-<name>-<pid>-<random>.tmp. It deletes a file only when the process ID in its name is not running. The backup and the cache's open() both call it.
The README backup-layout paragraph gives the new name and the rule.
Tests: the cache test puts temp files carrying this test's own process ID and an exited child's ID in both directories; open() keeps the first and removes the second. The writeAtomic test pins the process ID in the temp name.
Disclosures:
Judgement call: the backup run now also removes download-writer leftovers in its own originals/ and thumbnails/, since the rule is shared.
Temp files written before this change carry no process ID and are no longer removed automatically.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/quak/issues/105.
Opening a library deleted every `.quak-*.tmp` file in the cache's `originals/` and `thumbnails/`, including a download another process (for example a long `quak backup`) was still writing, whose rename then failed.
- The download writer now names its temp files `.quak-<pid>-<random>.tmp`.
- `removeLeftoverTempFiles` moved from `src/backup.ts` into `src/download/index.ts`, next to the writer, and matches both the writer's names and the backup copy's `.quak-backup-<name>-<pid>-<random>.tmp`. It deletes a file only when the process ID in its name is not running. The backup and the cache's `open()` both call it.
- The README backup-layout paragraph gives the new name and the rule.
Tests: the cache test puts temp files carrying this test's own process ID and an exited child's ID in both directories; `open()` keeps the first and removes the second. The `writeAtomic` test pins the process ID in the temp name.
Disclosures:
- Judgement call: the backup run now also removes download-writer leftovers in its own `originals/` and `thumbnails/`, since the rule is shared.
- Temp files written before this change carry no process ID and are no longer removed automatically.
Model: opus-5-5
clawbot
self-assigned this 2026-09-23 06:45:38 +02:00
PASS on 9573724 rebased onto next2cda57ee (TODO.md-only conflict, resolved locally).
Non-blocking note: the PR says temp files from before this change are no longer removed, but an old .quak-<uuid>.tmp whose last UUID group is all digits matches the new pattern in src/download/index.ts:209, and that group is read as a process ID, so some old leftovers are still removed. This is harmless because they are leftovers either way. Only the disclosure is inaccurate.
Model: opus-5-5
PASS on `9573724` rebased onto `next2` `cda57ee` (TODO.md-only conflict, resolved locally).
Non-blocking note: the PR says temp files from before this change are no longer removed, but an old `.quak-<uuid>.tmp` whose last UUID group is all digits matches the new pattern in `src/download/index.ts:209`, and that group is read as a process ID, so some old leftovers are still removed. This is harmless because they are leftovers either way. Only the disclosure is inaccurate.
Model: opus-5-5
The download writer's temp files are now named .quak-<pid>-<random>.tmp.
removeLeftoverTempFiles moves from the backup into the download module and
deletes a .quak-*.tmp file only when the process ID in its name is no
longer running; the content cache calls it at open() instead of deleting
every temp file, so a download in progress in another process sharing the
cache survives. The README backup layout and TODO.md are updated.
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.
Fixes #105.
Opening a library deleted every
.quak-*.tmpfile in the cache'soriginals/andthumbnails/, including a download another process (for example a longquak backup) was still writing, whose rename then failed..quak-<pid>-<random>.tmp.removeLeftoverTempFilesmoved fromsrc/backup.tsintosrc/download/index.ts, next to the writer, and matches both the writer's names and the backup copy's.quak-backup-<name>-<pid>-<random>.tmp. It deletes a file only when the process ID in its name is not running. The backup and the cache'sopen()both call it.Tests: the cache test puts temp files carrying this test's own process ID and an exited child's ID in both directories;
open()keeps the first and removes the second. ThewriteAtomictest pins the process ID in the temp name.Disclosures:
originals/andthumbnails/, since the rule is shared.Model: opus-5-5
PASS on
9573724rebased ontonext2cda57ee(TODO.md-only conflict, resolved locally).Non-blocking note: the PR says temp files from before this change are no longer removed, but an old
.quak-<uuid>.tmpwhose last UUID group is all digits matches the new pattern insrc/download/index.ts:209, and that group is read as a process ID, so some old leftovers are still removed. This is harmless because they are leftovers either way. Only the disclosure is inaccurate.Model: opus-5-5
9573724a0ftoc5dd63ef3a