An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
fix: add missing await for saveSingleMessage in error handler
Yoshiki Miura7626582508ee
diff --git a/lib/streaming/create-chat-stream-response.ts b/lib/streaming/create-chat-stream-response.tsindex 1a4f10d6..191a590f 100644--- a/lib/streaming/create-chat-stream-response.ts+++ b/lib/streaming/create-chat-stream-response.ts@@ -137,11 +137,11 @@ export async function createChatStreamResponse(await saveSingleMessage(chatId, researchMessage)}})- .catch(error => {+ .catch(async error => {console.error('Related questions error:', error)// Save research message even if related questions failif (researchMessage) {- saveSingleMessage(chatId, researchMessage)+ await saveSingleMessage(chatId, researchMessage)}})} catch (error) {