openimsdk / open-im-sdk-web-wasm

JS SDK for OpenIM Web use by Webassembly of go
https://openim.io
Apache License 2.0
29 stars 37 forks source link

Bug: conversation.latestMsg.isRead always* FALSE for my messages #64

Closed blitzederich closed 5 months ago

blitzederich commented 9 months ago

What happened?

The read status of my message in the list of all conversations is always FALSE. If we get a list of conversations via getAllConversationList, then in all chats where the last message is mine, we will get the status that the message was not read by the interlocutor. But if you look at the read status of the last message via getAdvancedHistoryMessageList we will see that the message has been read.

What did you expect to happen?

conversation.latestMsg.isRead equal messages[0].isRead

How can we reproduce it (as minimally and precisely as possible)?

const myUserID = 'myUserID';

const { data: chats } = await getAllConversationList();
const { data: messages } = await getAdvancedHistoryMessageList({
        conversationID: 'conversationID',
    count: 1,
    groupID: '',
    startClientMsgID: '',
    lastMinSeq: 0,
});

const chat = chats.find(chat => chat.conversationID === 'conversationID');
const chatLatestMsg = JSON.parse(chat.latestMsg);

const result = chatLatestMsg.isRead === messages[0].isRead; 
console.log(result); // `false` if messages[0].sendID === myUserID and messages[0].isRead === `true`

Anything else we need to know?

No response

version

version: open-im-sdk-wasm 3.1.0

Cloud provider

It doesn't matter

OS version

No response

Install tools

No response

Bloomingg commented 5 months ago

fixed in 3.5.0+