lockBackupDirectory in src/backup.ts calls proper-lockfile without an onCompromised handler. The library's default handler throws from inside a timer, which ends the process with a raw stack trace. This happens when the lock is lost while a backup runs: backup.lock is removed, or a second backup takes it over after it went 10 seconds without being touched (the first process was stopped or stalled). Reproduced on next at 2402ec9: take the lock with lockBackupDirectory, remove backup.lock, and within seconds the process dies in proper-lockfile's default onCompromised, printing an ECOMPROMISED stack trace. Every other error in quak is printed as one line (src/cli-run.ts).
Definition of done
When the lock is lost, the backup stops before it starts another file, and quak backup prints one line, quak: lost the lock on DIR: REASON, with no stack trace, and exits 1. lib.backup() rejects with an error saying the same.
Library code never calls process.exit and never throws from a timer.
Tests: removing backup.lock during a backup stops it with that error; a backup whose lock stays held runs to the end as before.
README ("Backup layout", the paragraph on backup.lock) says what happens when the lock is lost.
Model: opus-5-5
## Problem
`lockBackupDirectory` in `src/backup.ts` calls proper-lockfile without an `onCompromised` handler. The library's default handler throws from inside a timer, which ends the process with a raw stack trace. This happens when the lock is lost while a backup runs: `backup.lock` is removed, or a second backup takes it over after it went 10 seconds without being touched (the first process was stopped or stalled). Reproduced on `next` at `2402ec9`: take the lock with `lockBackupDirectory`, remove `backup.lock`, and within seconds the process dies in proper-lockfile's default `onCompromised`, printing an `ECOMPROMISED` stack trace. Every other error in quak is printed as one line (`src/cli-run.ts`).
## Definition of done
- When the lock is lost, the backup stops before it starts another file, and `quak backup` prints one line, `quak: lost the lock on DIR: REASON`, with no stack trace, and exits 1. `lib.backup()` rejects with an error saying the same.
- Library code never calls `process.exit` and never throws from a timer.
- Tests: removing `backup.lock` during a backup stops it with that error; a backup whose lock stays held runs to the end as before.
- README ("Backup layout", the paragraph on `backup.lock`) says what happens when the lock is lost.
Model: opus-5-5
clawbot
added this to the 1.0.0 milestone 2026-10-14 01:33:13 +02:00
Built in #193: the lock records why it was lost instead of throwing from proper-lockfile's timer, and the backup stops before its next original with lost the lock on DIR: REASON, printed by quak backup as one line with exit 1.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/quak/pulls/193: the lock records why it was lost instead of throwing from proper-lockfile's timer, and the backup stops before its next original with `lost the lock on DIR: REASON`, printed by `quak backup` as one line with exit 1.
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
lockBackupDirectoryinsrc/backup.tscalls proper-lockfile without anonCompromisedhandler. The library's default handler throws from inside a timer, which ends the process with a raw stack trace. This happens when the lock is lost while a backup runs:backup.lockis removed, or a second backup takes it over after it went 10 seconds without being touched (the first process was stopped or stalled). Reproduced onnextat2402ec9: take the lock withlockBackupDirectory, removebackup.lock, and within seconds the process dies in proper-lockfile's defaultonCompromised, printing anECOMPROMISEDstack trace. Every other error in quak is printed as one line (src/cli-run.ts).Definition of done
quak backupprints one line,quak: lost the lock on DIR: REASON, with no stack trace, and exits 1.lib.backup()rejects with an error saying the same.process.exitand never throws from a timer.backup.lockduring a backup stops it with that error; a backup whose lock stays held runs to the end as before.backup.lock) says what happens when the lock is lost.Model: opus-5-5
Built in #193: the lock records why it was lost instead of throwing from proper-lockfile's timer, and the backup stops before its next original with
lost the lock on DIR: REASON, printed byquak backupas one line with exit 1.Model: opus-5-5