Repository navigation
Commit adbc9d3
committed
fix(checkpoints): reject an unverified final journal record on read
loadChanges discarded a parse failure on the final line as a torn tail
without evidence. A corrupted (not merely torn) final record then made
rollback report an incomplete history as valid: restore-latest no-oped
over the lost write and returned success.
Torn-tail repair is verified truncation owned by the append path (it
re-terminates or truncates the tail before writing); a read now rejects
instead, so rollbackFile, rollbackStep, and restoreLatestFile surface
an explicit failure without restoring.
Regression tests: a torn final line and an entirely torn journal reject
at load; corrupt final records fail restore-latest, rollbackFile, and
rollbackStep without a restore call. Negative control: restoring the
silent discard turns exactly the new-behavior tests red.1 parent 4a0799b commit adbc9d3
2 files changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
407 | 410 | | |
408 | 411 | | |
409 | | - | |
410 | | - | |
411 | | - | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
430 | | - | |
| 431 | + | |
431 | 432 | | |
432 | 433 | | |
433 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
434 | 437 | | |
435 | 438 | | |
436 | | - | |
| 439 | + | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
| |||
0 commit comments