From 13135ec51b42abf7761911444222c92e755c2697 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 16 Jan 2026 20:17:11 +0200 Subject: [PATCH] fix: eagerly load message relationship in get_user_mentions --- surfsense_backend/app/services/chat_comments_service.py | 1 + 1 file changed, 1 insertion(+) diff --git a/surfsense_backend/app/services/chat_comments_service.py b/surfsense_backend/app/services/chat_comments_service.py index c59cbc918..f00145b82 100644 --- a/surfsense_backend/app/services/chat_comments_service.py +++ b/surfsense_backend/app/services/chat_comments_service.py @@ -589,6 +589,7 @@ async def get_user_mentions( .join(NewChatThread, NewChatMessage.thread_id == NewChatThread.id) .options( selectinload(ChatCommentMention.comment).selectinload(ChatComment.author), + selectinload(ChatCommentMention.comment).selectinload(ChatComment.message), ) .filter(ChatCommentMention.mentioned_user_id == user.id) .order_by(ChatCommentMention.created_at.desc())