fix(chat): 群聊消息查询不带owner(chat_group按room去重owner被末位员工覆盖,与消息归属错位查空)

room 全局唯一且消息只在单一owner名下(多owner群=0),按room查即正确;
MessageQuery.owner_account_id 改可选。实测43304群6000条正常显示。
16个活跃群0条消息=增量未覆盖,4h调度自动补

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-22 16:50:56 +08:00
parent d08255696c
commit 4f375c3d71
2 changed files with 9 additions and 6 deletions
+7 -5
View File
@@ -170,11 +170,13 @@ function scrollToBottom(): void {
function queryFor(pageNum: number) {
return {
channel: channelTyped.value,
owner_account_id: props.ownerId,
talker_id: isGroup.value ? undefined : props.talkerId,
room_id: isGroup.value ? props.roomId : undefined,
start: winStart.value,
end: winEnd.value,
// 群聊不带 owner:chat_group 表按 room_id 去重、owner 被最后写入的员工
// 覆盖,与消息实际归属的 owner 错位会查空(实测 2026-08-22);room 全局
// 唯一且消息只在单一 owner 名下(多 owner 群=0),按 room 查即正确。
...(isGroup.value
? { room_id: props.roomId as string }
: { owner_account_id: props.ownerId, talker_id: props.talkerId as string }),
...(winStart.value != null && winEnd.value != null ? { start: winStart.value, end: winEnd.value } : {}),
page: pageNum,
page_size: PAGE_SIZE,
}