huskies: merge 894
This commit is contained in:
+31
-4
@@ -19,11 +19,9 @@ pub mod content_store;
|
||||
pub mod ops;
|
||||
/// Background shadow-write task — persists pipeline items to SQLite asynchronously.
|
||||
pub mod shadow_write;
|
||||
/// Legacy YAML helpers — used by the migration and by callers reading the
|
||||
/// small set of fields not yet mirrored into the CRDT.
|
||||
/// Legacy YAML helpers — used by callers reading the small set of fields not
|
||||
/// yet mirrored into the CRDT.
|
||||
pub(crate) mod yaml_legacy;
|
||||
/// One-shot migration that strips legacy YAML front-matter from stored content (story 865).
|
||||
pub mod yaml_migration;
|
||||
|
||||
pub use content_store::{all_content_ids, delete_content, read_content, write_content};
|
||||
pub use ops::{ItemMeta, delete_item, move_item_stage, next_item_number, write_item_with_content};
|
||||
@@ -384,6 +382,35 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// Regression (story 894): startup with no YAML migration call leaves
|
||||
/// existing clean content readable and unmodified. Verifies that removing
|
||||
/// `db::yaml_migration::run()` from the startup path does not break reads.
|
||||
#[test]
|
||||
fn startup_reads_clean_content_unchanged() {
|
||||
crate::crdt_state::init_for_test();
|
||||
ensure_content_store();
|
||||
let story_id = "9894_story_clean_content";
|
||||
|
||||
// Plain body — no YAML block, representing post-migration state.
|
||||
let body = "# Story Heading\n\nSome content.\n";
|
||||
write_item_with_content(
|
||||
story_id,
|
||||
"2_current",
|
||||
body,
|
||||
ItemMeta {
|
||||
name: Some("Clean".into()),
|
||||
..ItemMeta::default()
|
||||
},
|
||||
);
|
||||
|
||||
let read_back = read_content(story_id).expect("content present");
|
||||
assert_eq!(read_back, body, "plain content must be readable as-is");
|
||||
assert!(
|
||||
!read_back.trim_start().starts_with("---"),
|
||||
"no YAML header should appear"
|
||||
);
|
||||
}
|
||||
|
||||
/// Bug 780: stage transitions must reset retry_count to 0 in the CRDT.
|
||||
/// Carryover from prior-stage retries was tripping the auto-assigner's
|
||||
/// deterministic-merge skip logic.
|
||||
|
||||
Reference in New Issue
Block a user