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

[BUG] About the bug that the number of unread messages cannot be cleared #556

Open
skywangch opened this issue Jun 12, 2024 · 1 comment
Assignees
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@skywangch
Copy link

skywangch commented Jun 12, 2024

OpenIM Server Version

3.7.1

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

The root of the issue is a bug in the mini-program side when calling OIMWS, but after reviewing the code, the core implementation was found in openim-sdk-core. The number of unread messages is displayed incorrectly, and even after successfully making a call to set the conversation as read, the message count does not reset and remains unchanged. Upon investigating the code at openim-sdk-core/[email protected]/internal/conversation_msg/read_drawing.go: 142, it was discovered that the unread message list is retrieved first, and then the message count table is cleared. However, if the unread message list is empty, it directly returns, and at this time, the count table might still be greater than zero (due to some inconsistencies). Unless a new unread message is received, the code to clear the count table is unreachable, and the count can never be reset to zero.

Suggestion: Execute the subsequent code regardless of whether the SQLite message table's unread messages are empty or not; do not return prematurely.

Screenshots Link

相关代码:
765e67d55aa54e8c5ff6674c24f2ec9

前端调用 markConversationMessageAsRead, 服务端 oimws 产生的日志:
0b132ca5f55b4c28e4fe9421a020a65

local db 消息表:
image

local db 会话表:
image

@skywangch skywangch added the bug Categorizes issue or PR as related to a bug. label Jun 12, 2024
@kubbot kubbot changed the title [BUG] 关于未读消息数目不能被清空的bug [BUG] About the bug that the number of unread messages cannot be cleared Jun 12, 2024
@skiffer-git
Copy link
Member

The OIMWS will be phased out, and a new JavaScript SDK is currently under development. This upcoming SDK promises more advanced features and improved performance

@mo3et mo3et self-assigned this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants