openimsdk / oimws

A websocket and tcp framework for openim
MIT License
17 stars 14 forks source link

[BUG] The problem of inaccurate display of the number of unread messages #143

Open skywangch opened 4 weeks ago

skywangch commented 4 weeks ago

OpenIM Server Version

3.7.1

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

版本 commit: ea4d8b6c05e5176f104543e7519405d2801f25c9 未读消息的数目显示不正确,并且当成功发起调用请求,设置会话为已读后,消息数目不能清除,依然保持原来的数目。排查代码 openim-sdk-core/v3@v3.5.1/internal/conversation_msg/read_drawing.go: 142 发现是先获取未读消息列表,然后再清空消息计数表。但是如果未读消息列表为空的时候,就直接返回了,这时候可能计数表大于0(由于某些原因造成的不一致),除非接收到新的未读消息,否则清空计数表的代码不可到达,永远无法清零。

Screenshots Link

相关代码:

765e67d55aa54e8c5ff6674c24f2ec9

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

0b132ca5f55b4c28e4fe9421a020a65
kubbot commented 4 weeks ago

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

Join slack 🤖 to connect and communicate with our developers.