Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Other]: RedisConsumerHandler created a BUG conversationID #2586

Open
zhaolibo1989 opened this issue Sep 2, 2024 · 0 comments
Open

[Other]: RedisConsumerHandler created a BUG conversationID #2586

zhaolibo1989 opened this issue Sep 2, 2024 · 0 comments
Labels
other Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@zhaolibo1989
Copy link

What would you like to share?

Review this func:
https://github.com/openimsdk/open-im-server/blob/v3.8.0/internal/msgtransfer/online_history_msg_handler.go#L93

storageMsgList, notStorageMsgList, storageNotificationList, notStorageNotificationList := och.categorizeMessageLists(ctxMessages)
conversationIDMsg := msgprocessor.GetChatConversationIDByMsg(ctxMessages[0].message)
conversationIDNotification := msgprocessor.GetNotificationConversationIDByMsg(ctxMessages[0].message)
och.handleMsg(ctx, val.Key(), conversationIDMsg, storageMsgList, notStorageMsgList)
och.handleNotification(ctx, val.Key(), conversationIDNotification, storageNotificationList, notStorageNotificationList)

This is a test case, the data is intentionally set and may occur. "32499" is user, and "openIMAdmin" is manager.

len(ctxMessages) = 2
ctxMessages[0] = Msg{sendID:"32499", recvID:"openIMAdmin", sessionType:4, contentType:2200(HasReadReceipt), ...}
ctxMessages[1] = Msg{sendID:"openIMAdmin", recvID:"32499", sessionType:4, contentType:1400(OANotification), ...}
storageMsgList = {ctxMessages[1]}
storageNotificationList = {ctxMessages[0]}

In fact, it has already happened in my debugging environment. To simplify, I only described the key data.

Based on the data above, we expected to get a chat conversation "sn_openIMAdmin_32499" and a notification conversation "n_32499_openIMAdmin," but that is not the result. Actally, that add an abnormal conversation with conversionID = sn_32499_openIMAdmin to the database. After that, the SDK will also have an additional abnormal conversation. Finally, the APP will display two conversations with the same userID openIMAdmin but different conversations sn_32499_openIMAdmin and sn_openIMAdmin_32499.

It is regrettable that I have not yet found an elegant solution.

Additional information

No response

@zhaolibo1989 zhaolibo1989 added the other Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

1 participant