From af1ecaf71e0b1f86e4a5e49579356668775f762c Mon Sep 17 00:00:00 2001 From: lan Date: Tue, 5 May 2026 02:00:40 +0800 Subject: [PATCH] fix(message): add missing BatchDecryptMessagesParallel in GetLastMessagesBatch GetLastMessagesBatch was returning empty segments because it skipped the decryption step that all other message query methods perform. Co-Authored-By: Claude Opus 4.7 --- internal/repository/message_repo.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/repository/message_repo.go b/internal/repository/message_repo.go index 7b78130..9bb7ec8 100644 --- a/internal/repository/message_repo.go +++ b/internal/repository/message_repo.go @@ -933,12 +933,15 @@ func (r *messageRepository) GetLastMessagesBatch(ctx context.Context, convIDs [] return nil, err } + if len(messages) > 0 { + model.BatchDecryptMessagesParallel(messages) + } + for _, m := range messages { result[m.ConversationID] = m } return result, nil } - // GetParticipantsBatch 批量获取多个会话的参与者列表 func (r *messageRepository) GetParticipantsBatch(ctx context.Context, convIDs []string) (map[string][]*model.ConversationParticipant, error) { result := make(map[string][]*model.ConversationParticipant, len(convIDs))