Fiks: SpacetimeDB reducers brukte _workspace_id som ga feil parameternavn i JSON

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
vegard 2026-03-16 18:00:31 +01:00
parent 02add1377e
commit fa74e255c9

View file

@ -209,8 +209,9 @@ pub fn edit_message(
pub fn set_ai_processing( pub fn set_ai_processing(
ctx: &ReducerContext, ctx: &ReducerContext,
id: String, id: String,
_workspace_id: String, workspace_id: String,
) -> Result<(), String> { ) -> Result<(), String> {
let _ = &workspace_id;
if let Some(mut msg) = ctx.db.chat_message().id().find(&id) { if let Some(mut msg) = ctx.db.chat_message().id().find(&id) {
// Merger ai_processing: true inn i metadata // Merger ai_processing: true inn i metadata
let mut meta: serde_json::Value = if msg.metadata.is_empty() { let mut meta: serde_json::Value = if msg.metadata.is_empty() {
@ -233,8 +234,9 @@ pub fn set_ai_processing(
pub fn clear_ai_processing( pub fn clear_ai_processing(
ctx: &ReducerContext, ctx: &ReducerContext,
id: String, id: String,
_workspace_id: String, workspace_id: String,
) -> Result<(), String> { ) -> Result<(), String> {
let _ = &workspace_id;
if let Some(mut msg) = ctx.db.chat_message().id().find(&id) { if let Some(mut msg) = ctx.db.chat_message().id().find(&id) {
if !msg.metadata.is_empty() { if !msg.metadata.is_empty() {
if let Ok(mut meta) = serde_json::from_str::<serde_json::Value>(&msg.metadata) { if let Ok(mut meta) = serde_json::from_str::<serde_json::Value>(&msg.metadata) {