Context
Blobs are imported using ImportMode::TryReference, which means the FsStore keeps a reference to the original file path on disk rather than copying it. If that file is deleted after import, the reference becomes dnagling/stale: peers requesting the blob receive an error. The failure is silent until a peer actually attempts the transfer.
Goal
Add a background file watcher in the daemon that monitors every path referenced by a blob hash and emits a warning log when a referenced file disappears or is moved.
Acceptance criteria
Out of scope
- Automatically removing or invalidating the blob from the store when a file disappears;
- Re-importing the blob if the original file reappears;
- Detecting hash content mismatch after an in-place file modification;
- Watching paths on network or remote filesystems;
- Sending integrity events to connected daemon clients over the IPC protocol.
Context
Blobs are imported using
ImportMode::TryReference, which means theFsStorekeeps a reference to the original file path on disk rather than copying it. If that file is deleted after import, the reference becomes dnagling/stale: peers requesting the blob receive an error. The failure is silent until a peer actually attempts the transfer.Goal
Add a background file watcher in the daemon that monitors every path referenced by a blob hash and emits a warning log when a referenced file disappears or is moved.
Acceptance criteria
Node::list_blobs);Op::Import, its source path is registered with the watcher;Op::BlobRemove, its path is deregistered from the watcher;inotify), macOS (viaFSEvents/kqueue), and Windows (viaReadDirectoryChangesW). Use the notify crate to abstract over all three;Out of scope