fix: eagerly load message relationship in get_user_mentions

This commit is contained in:
CREDO23 2026-01-16 20:17:11 +02:00
parent 985f50b683
commit 13135ec51b

View file

@ -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())