Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix: broken chat history query (#4756)
Wolf Mermelstein60d85543a0a6
diff --git a/crates/macro_db_client/src/chat_history/mod.rs b/crates/macro_db_client/src/chat_history/mod.rsindex b053c13e4d..8126ea63c5 100644--- a/crates/macro_db_client/src/chat_history/mod.rs+++ b/crates/macro_db_client/src/chat_history/mod.rs@@ -24,12 +24,12 @@ whereSELECTc.id as chat_id,c.title as chat_title,- m.content as message_content,+ m.content::text as message_content,m."createdAt" as message_created_at,ma."attachmentId" as attachment_idFROM "Chat" cJOIN "ChatMessage" m ON m."chatId" = c.id- LEFT JOIN "ChatMessageAttachment" ma ON ma."messageId" = m.id+ LEFT JOIN "ChatAttachment" ma ON ma."messageId" = m.idWHERE c.id = $1ORDER BY m."createdAt" ASC"#,@@ -55,12 +55,12 @@ whereSELECTc.id as chat_id,c.title as chat_title,- m.content as message_content,+ m.content::text as message_content,m."createdAt" as message_created_at,ma."attachmentId" as attachment_idFROM "Chat" cJOIN "ChatMessage" m ON m."chatId" = c.id- LEFT JOIN "ChatMessageAttachment" ma ON ma."messageId" = m.id+ LEFT JOIN "ChatAttachment" ma ON ma."messageId" = m.idWHERE m.id = ANY($1)ORDER BY m."createdAt" ASC"#,