fix(store): a drill and a preview keep the stored files the store reads when it verifies the books
The store's own verification reads the text an extraction recorded as a stored file, so a verification that left the stored files out would not prove books with extracted text. Every proof now builds the books with their stored files, as a restore does, and a test holds it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
a6cd89d2a6
commit
5d5f94e8dc
6 files changed
+69
-56
No files matched your search
@@ -364,7 +364,7 @@ async fn backed_up(c: &Client, within: Duration) -> Value {
|
||||
fn proven(home: &Home, source: &Path, tag: &str) -> (u64, String) {
|
||||
let scratch = home.outside(&format!("scratch-{tag}"));
|
||||
let found = find(source, None, &Ctx::new()).unwrap_or_else(|e| panic!("{tag}: {e}"));
|
||||
verify_found(&found, &scratch, false, &Ctx::new())
|
||||
verify_found(&found, &scratch, &Ctx::new())
|
||||
.unwrap_or_else(|e| panic!("{tag}: {e}"))
|
||||
.head
|
||||
}
|
||||
@@ -412,7 +412,7 @@ async fn a_book_backs_itself_up_to_its_folder_soon_after_a_write() {
|
||||
// Its journal is the live journal's beginning (a drill's check).
|
||||
let scratch = home.outside("scratch-prefix");
|
||||
let found = find(&folder, None, &Ctx::new()).unwrap();
|
||||
let v = verify_found(&found, &scratch, false, &Ctx::new()).unwrap();
|
||||
let v = verify_found(&found, &scratch, &Ctx::new()).unwrap();
|
||||
assert!(
|
||||
std::fs::read(home.book_dir("acme").join(ledger_store::JOURNAL_FILE))
|
||||
.unwrap()
|
||||
|
||||
@@ -1159,7 +1159,7 @@ fn proven_head(home: &Home, disk: &std::path::Path, tag: &str) -> (u64, String)
|
||||
use ledger_store::backup::{Ctx, find, verify_found};
|
||||
let scratch = home.dir.path().join(format!("scratch-{tag}"));
|
||||
let found = find(disk, None, &Ctx::new()).unwrap_or_else(|e| panic!("{tag}: {e}"));
|
||||
verify_found(&found, &scratch, false, &Ctx::new())
|
||||
verify_found(&found, &scratch, &Ctx::new())
|
||||
.unwrap_or_else(|e| panic!("{tag}: {e}"))
|
||||
.head
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user