From d80fc143c2efbf457bbc0b26abcdb92c35ad62ab Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 15 Apr 2026 17:23:22 +0000 Subject: [PATCH] huskies: merge 577_bug_show_command_reads_story_files_from_filesystem_instead_of_crdt --- server/src/chat/commands/show.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/server/src/chat/commands/show.rs b/server/src/chat/commands/show.rs index a3d6e402..cadb7d77 100644 --- a/server/src/chat/commands/show.rs +++ b/server/src/chat/commands/show.rs @@ -21,8 +21,8 @@ pub(super) fn handle_show(ctx: &CommandContext) -> Option { )); } - // Find the story by numeric prefix: CRDT → content store → filesystem. - let (story_id, _stage_dir, path, content) = + // Find the story by numeric prefix: CRDT → content store. + let (story_id, _stage_dir, _path, content) = match crate::chat::lookup::find_story_by_number(ctx.project_root, num_str) { Some(found) => found, None => { @@ -32,16 +32,11 @@ pub(super) fn handle_show(ctx: &CommandContext) -> Option { } }; - // `content` is populated from the content store (CRDT/DB path) or read - // from disk during the filesystem fallback. If it is None (story found in - // CRDT but no content-store entry yet), attempt a direct disk read. - Some( - content - .or_else(|| std::fs::read_to_string(&path).ok()) - .unwrap_or_else(|| { - format!("Story {story_id} found in pipeline but its content is unavailable.") - }), - ) + // `content` comes from the CRDT / content store. If unavailable, report + // it rather than silently reading a stale on-disk copy. + Some(content.unwrap_or_else(|| { + format!("Story {story_id} found in pipeline but its content is unavailable.") + })) } #[cfg(test)]