fix(im): 修复历史退群群未读和成员加载问题
- 已读上报使用会话末条消息编号兜底 - 历史退群群不再请求群成员列表 - 群聊 read 放开当前成员校验,保留可见性校验 - Vben 群详情补齐 joinStatus - 补充退群群已读边界测试pull/884/MERGE
parent
cb625d11bb
commit
ddafacf64d
|
|
@ -437,12 +437,15 @@ const groupMembers = computed<GroupMemberLite[]>(() => {
|
|||
})
|
||||
})
|
||||
|
||||
/** 切换到群会话时同步群信息 + 成员;各自 fire-and-forget + catch,任何一项失败不牵连其它 */
|
||||
/** 切换到群会话时同步群信息 + 成员 */
|
||||
async function ensureGroupData(groupId: number) {
|
||||
// 远程异步拉群信息(群名 / 公告 / 群主等元数据)
|
||||
groupStore.fetchGroupInfo(groupId).catch((error) => {
|
||||
// 远程拉群信息(群名 / 公告 / 群主等元数据)
|
||||
await groupStore.fetchGroupInfo(groupId).catch((error) => {
|
||||
console.warn('[IM MessagePanel] fetchGroupInfo 失败', { groupId }, error)
|
||||
})
|
||||
if (isGroupQuit(groupStore.getGroup(groupId))) {
|
||||
return
|
||||
}
|
||||
|
||||
// 先从 IDB 同步加载群成员,让首帧立即出成员名 / 头像
|
||||
await groupStore.loadGroupMemberList(groupId).catch((error) => {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import {
|
|||
} from '../../utils/message'
|
||||
import { resolveConversationLastContent } from '../../utils/conversation'
|
||||
import { getCurrentUserId } from '@/utils/auth'
|
||||
import { tryGetSenderDisplayName } from '../../utils/user'
|
||||
import { isGroupQuit, tryGetSenderDisplayName } from '../../utils/user'
|
||||
import { useGroupStore } from './groupStore'
|
||||
import { useConversationStore } from './conversationStore'
|
||||
import type { ImConversationReadRespVO } from '@/api/im/conversation/read'
|
||||
|
|
@ -137,6 +137,9 @@ function deriveLastSenderDisplayName(
|
|||
if (conversation.type === ImConversationType.GROUP) {
|
||||
const groupStore = useGroupStore()
|
||||
const group = groupStore.getGroup(conversation.targetId)
|
||||
if (isGroupQuit(group)) {
|
||||
return conversation.lastSenderId === senderId ? conversation.lastSenderDisplayName : undefined
|
||||
}
|
||||
const fetchPromise =
|
||||
group?.membersLoaded && !group.membersExpired
|
||||
? groupStore.fetchGroupMember(conversation.targetId, senderId)
|
||||
|
|
|
|||
Loading…
Reference in New Issue