From ee0427931914fc70a980ce0929dd42b1b8a64ce7 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 12 Aug 2025 10:33:25 +0200 Subject: [PATCH] Insert Conv only if message was success --- Service/Plugins/AiService2.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Service/Plugins/AiService2.cs b/Service/Plugins/AiService2.cs index c7ccbf250..e3cce480f 100644 --- a/Service/Plugins/AiService2.cs +++ b/Service/Plugins/AiService2.cs @@ -124,6 +124,8 @@ namespace BeWo.Service.Plugins var conv = createAiConversation(conversation.UIContext, conversation.ContextBeWoObjects, modell_oid, config.Context_Type); + DAOFactory.GenericDAO.Insert(conv); + var conv_dc = MapperFactory.AiConversation.MapToNewDC(conv); return conv_dc; @@ -136,6 +138,8 @@ namespace BeWo.Service.Plugins var new_messages = sendNewMessage(conv, message, config); + DAOFactory.GenericDAO.Insert(conv); + var conv_dc = MapperFactory.AiConversation.MapToNewDC(conv); return conv_dc; @@ -287,8 +291,6 @@ namespace BeWo.Service.Plugins conv.Messages.Add(msg); - DAOFactory.GenericDAO.Insert(conv); - return conv; }