Created attachment 183016 [details] Terminal errors after deleting chat: message not removed. Chat "ccc" still visible. KAIChat 0.33, KDE Plasma 6.4.2. SUMMARY Chat appears to be deleted but reappears after restarting KAIChat STEPS TO REPRODUCE 1. Open KAIChat 2. Right-click on a conversation in the list 3. Select "Delete" 4. Observe that the chat disappears from the UI 5. Restart the application OBSERVED RESULT The chat seems to be deleted at first, but it reappears after restarting the application. EXPECTED RESULT The selected chat should be permanently deleted and not come back after restart. SOFTWARE/OS VERSIONS Operating System: CachyOS (Arch-based) KDE Plasma Version: 6.4.2 KDE Frameworks Version: 6.4.2 Qt Version: 6.9.1 KAIChat Version: 0.33 (built from source, master branch) ADDITIONAL INFORMATION I launched KAIChat via terminal to investigate the issue. When deleting a chat, the following messages appear: org.kde.kf.textautogeneratetext.database: Filename doesn't exist: "/home/simone/.local/share/kaichat/ai-database/messages/..." org.kde.kf.textautogeneratetext.database: The assumption was wrong, deleteMessage was called before addMessage qt.sql.qsqldatabase: QSqlDatabasePrivate::removeDatabase: connection ... is still in use, all queries will cease to work. It appears that deleteMessage() is being called before addMessage(), meaning the deletion is not correctly persisted in the database. This results in the conversation being visually removed only temporarily and returning after a restart. A screenshot of the terminal output is attached.
Hi, Yep I can reproduce it. I will work on it soon. Regards
Git commit 04b0ef56fbfaa8568fd47126b84b4445a96d57f9 by Laurent Montel. Committed on 23/07/2025 at 11:09. Pushed by mlaurent into branch 'master'. Fix delete chat M +1 -1 textautogeneratetext/core/autotests/textautogeneratelocalchatsdatabasetest.cpp M +1 -0 textautogeneratetext/core/autotests/textautogeneratelocalmessagesdatabasetest.cpp M +1 -1 textautogeneratetext/core/localdatabase/textautogeneratelocalchatsdatabase.cpp https://invent.kde.org/libraries/ktextaddons/-/commit/04b0ef56fbfaa8568fd47126b84b4445a96d57f9