Skip to content

Commit 8cdeeac

Browse files
ellieclaude
andcommitted
fix: deserialize KV values as JSON objects then serialize to string
KV stores JSON objects directly. Get as Value and serialize to string for the runtime to parse. 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent ceb773f commit 8cdeeac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/src/commands/blocks.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ impl LocalValueProvider for KvBlockLocalValueProvider {
7272
.await
7373
.map_err(|_| Box::new(std::io::Error::other("Failed to open KV database")))?;
7474
let key = format!("block.{block_id}.{property_name}");
75-
kv::get(&db, &key).await.map_err(|e| e.into())
75+
// KV stores JSON objects; serialize to string for the runtime to parse
76+
let value: Option<serde_json::Value> = kv::get(&db, &key).await?;
77+
Ok(value.map(|v| v.to_string()))
7678
}
7779
}
7880

0 commit comments

Comments
 (0)