huskies: merge 961

This commit is contained in:
dave
2026-05-13 11:22:57 +00:00
parent 78b1ecdc3c
commit 8b53e20ca9
38 changed files with 327 additions and 146 deletions
+5 -5
View File
@@ -4,7 +4,7 @@
//! content store, the CRDT (source of truth for metadata), and the SQLite
//! shadow table (via the background channel).
use super::content_store::{
all_content_ids, delete_content, ensure_content_store, read_content, write_content,
ContentKey, all_content_ids, delete_content, ensure_content_store, read_content, write_content,
};
use super::shadow_write::{PIPELINE_DB, PipelineWriteMsg};
@@ -74,7 +74,7 @@ pub fn write_item_with_content(story_id: &str, stage: &str, content: &str, meta:
// Update in-memory content store.
ensure_content_store();
write_content(story_id, content);
write_content(ContentKey::Story(story_id), content);
// Primary: CRDT ops.
let stage = normalise_stage_str(stage);
@@ -123,12 +123,12 @@ pub fn move_item_stage(
new_stage: &str,
content_transform: Option<&dyn Fn(&str) -> String>,
) {
let current_content = read_content(story_id);
let current_content = read_content(ContentKey::Story(story_id));
let content = match (&current_content, content_transform) {
(Some(c), Some(transform)) => {
let new_content = transform(c);
write_content(story_id, &new_content);
write_content(ContentKey::Story(story_id), &new_content);
Some(new_content)
}
(Some(c), None) => Some(c.clone()),
@@ -192,7 +192,7 @@ pub fn move_item_stage(
/// Delete a story from the shadow table (fire-and-forget).
pub fn delete_item(story_id: &str) {
delete_content(story_id);
delete_content(ContentKey::Story(story_id));
if let Some(db) = PIPELINE_DB.get() {
// Reuse the channel with a special "deleted" stage marker.