Skip to content

fix(storage): preserve ledger and images after load failures - #87

Merged
cloader merged 2 commits into
devfrom
fix/corrupt-ledger-protection
Nov 1, 2026
Merged

cloader merged 2 commits into
devfrom
fix/corrupt-ledger-protection

Conversation

@cloader

@cloader cloader commented Nov 1, 2026

Copy link
Copy Markdown
Owner

What changed

When the ledger was damaged or unreadable at startup, the board silently started empty and attachment cleanup could permanently delete old images. Retain the original file and block writes, migration, and attachment cleanup until the ledger is repaired or restored and DSH restarts. Show the recovery error and file path through the board and storage status.

Validation

  • Node 22.23.1 and Node 26.13.0: typecheck, full build, and all 654 tests in 50 files passed.
  • Added 17 regression cases, including real host subprocesses checking repeated restarts, old-image preservation, API/tool errors, and no unhandled rejection; file-read errors cover EACCES, EBUSY, and EIO.
  • The first Node 26 full run hit a Windows EPERM race in the existing cross-process ledger-lock test. The isolated lock suite and a subsequent full run passed without changes to the lock implementation.

Fixes #84

@cloader
cloader merged commit 241c817 into dev Nov 1, 2026
2 checks passed
@cloader
cloader deleted the fix/corrupt-ledger-protection branch November 1, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] A corrupt ledger at cold start is silently discarded and the boot-time attachment GC permanently deletes referenced images

1 participant