diff --git a/sdk/state/Conversation.class.js b/sdk/state/Conversation.class.js index f57607e99eb46b14d531995fc5c0eef5cefb07a8..41fc0f3e427e17d8c71adde9f7e46986e24ed2de 100644 --- a/sdk/state/Conversation.class.js +++ b/sdk/state/Conversation.class.js @@ -129,12 +129,16 @@ export default class Conversation extends CloudData { // console.log('新增会话', item) // 插入客户端创建此会话的时间 item.client_create_time = Date.now() - let conversation = new ConversationItem(item) - // console.log('新增会话', conversation) - const usersInfo = conversation.getUsersInfo() - // 把会话相关的用户信息合并到 $users - $users.merge(usersInfo) - resList.push(conversation) + try{ + let conversation = new ConversationItem(item) + // console.log('新增会话', conversation) + const usersInfo = conversation.getUsersInfo() + // 把会话相关的用户信息合并到 $users + $users.merge(usersInfo) + resList.push(conversation) + }catch(e){ + $utils.reportError(e) + } return resList }, []) } diff --git a/sdk/state/ConversationItem.class.js b/sdk/state/ConversationItem.class.js index f9c68aca1dea530fed5bb29eab5794027c2b0f4b..fba687569699502bf4aeb0353c2bd2158f3ab6af 100644 --- a/sdk/state/ConversationItem.class.js +++ b/sdk/state/ConversationItem.class.js @@ -11,8 +11,9 @@ class ConversationItem { constructor(data) { // 检查是否关联用户/群被删除 if (!data.group_id && !data.user_info) { - console.error(JSON.stringify(data)); - throw new Error('会话列表失效,疑似关联用户/群被删除(请改为软删除避免系统异常)'); + // 删除本地生成的 data.client_create_time 避免错误重复上报 + delete data.client_create_time + throw new Error('会话列表失效,疑似关联用户/群被删除(请改为软删除避免系统异常)data:'+JSON.stringify(data)); } // 对话框消息内容 this.chatInputContent = ""