Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🛠️ fix: Update Conversation and Message Models to Return Objects Instead of Using Lean() (#3230)
Danny Avilaa87d4e0b7587
diff --git a/api/models/Conversation.js b/api/models/Conversation.jsindex c554c9da79..d5a67f0e4d 100644--- a/api/models/Conversation.js+++ b/api/models/Conversation.js@@ -27,10 +27,12 @@ module.exports = {update.conversationId = newConversationId;}- return await Conversation.findOneAndUpdate({ conversationId: conversationId, user }, update, {+ const conversation = await Conversation.findOneAndUpdate({ conversationId, user }, update, {new: true,upsert: true,- }).lean();+ });++ return conversation.toObject();} catch (error) {logger.error('[saveConvo] Error saving conversation', error);return { message: 'Error saving conversation' };diff --git a/api/models/Message.js b/api/models/Message.jsindex c04bb3c7ef..b9c82ca36b 100644--- a/api/models/Message.js+++ b/api/models/Message.js@@ -58,10 +58,12 @@ module.exports = {update.files = files;}- return await Message.findOneAndUpdate({ messageId }, update, {+ const message = await Message.findOneAndUpdate({ messageId }, update, {upsert: true,new: true,- }).lean();+ });++ return message.toObject();} catch (err) {logger.error('Error saving message:', err);throw new Error('Failed to save message.');