huskies: merge 961
This commit is contained in:
@@ -179,7 +179,7 @@ pub fn get_work_item_content(
|
||||
}
|
||||
|
||||
// CRDT-only fallback
|
||||
if let Some(content) = crate::db::read_content(story_id) {
|
||||
if let Some(content) = crate::db::read_content(crate::db::ContentKey::Story(story_id)) {
|
||||
let item = crate::pipeline_state::read_typed(story_id)
|
||||
.map_err(|e| Error::Io(format!("Pipeline read error: {e}")))?;
|
||||
let stage = match item.as_ref() {
|
||||
|
||||
@@ -663,7 +663,7 @@ mod tests {
|
||||
let content = "---\nname: Foo\n---\n";
|
||||
fs::write(backlog.join("9905_story_foo.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("9905_story_foo", content);
|
||||
crate::db::write_content(crate::db::ContentKey::Story("9905_story_foo"), content);
|
||||
|
||||
let store = Arc::new(TimerStore::load(root.join("timers.json")));
|
||||
let past = Utc::now() - Duration::seconds(5);
|
||||
@@ -682,7 +682,7 @@ mod tests {
|
||||
);
|
||||
// Story should still be accessible in the content store after the move.
|
||||
assert!(
|
||||
crate::db::read_content("9905_story_foo").is_some(),
|
||||
crate::db::read_content(crate::db::ContentKey::Story("9905_story_foo")).is_some(),
|
||||
"story should be in the content store after tick fires"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ mod tests {
|
||||
let content = "---\nname: Foo\n---\n";
|
||||
fs::write(backlog.join("421_story_foo.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("421_story_foo", content);
|
||||
crate::db::write_content(crate::db::ContentKey::Story("421_story_foo"), content);
|
||||
|
||||
// Add a past timer so take_due returns it immediately.
|
||||
let store = TimerStore::load(root.join("timers.json"));
|
||||
@@ -456,7 +456,7 @@ mod tests {
|
||||
|
||||
// Story must still be accessible in the content store after the move.
|
||||
assert!(
|
||||
crate::db::read_content("421_story_foo").is_some(),
|
||||
crate::db::read_content(crate::db::ContentKey::Story("421_story_foo")).is_some(),
|
||||
"story should be in the content store after timer fires"
|
||||
);
|
||||
// Timer was consumed.
|
||||
|
||||
@@ -55,7 +55,8 @@ pub async fn delete_work_item(
|
||||
// Pre-flight: check whether the item exists in any store before doing
|
||||
// destructive work. We probe the content store, CRDT, and filesystem
|
||||
// shadow dirs so we can return a clear "not found" when nothing matches.
|
||||
let found_in_content = crate::db::read_content(story_id).is_some();
|
||||
let found_in_content =
|
||||
crate::db::read_content(crate::db::ContentKey::Story(story_id)).is_some();
|
||||
let found_in_crdt = crate::pipeline_state::read_typed(story_id)
|
||||
.ok()
|
||||
.flatten()
|
||||
@@ -232,7 +233,7 @@ mod tests {
|
||||
|
||||
// Content store must be empty.
|
||||
assert!(
|
||||
crate::db::read_content(story_id).is_none(),
|
||||
crate::db::read_content(crate::db::ContentKey::Story(story_id)).is_none(),
|
||||
"content store must not contain the story after delete"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user