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

messageService.queryMessagesWithTotal 疑问 #1493

Open
lovemianhuatang opened this issue Jun 26, 2024 · 4 comments
Open

messageService.queryMessagesWithTotal 疑问 #1493

lovemianhuatang opened this issue Jun 26, 2024 · 4 comments
Labels
question How to do something status: confirming Confirming whether the issue is a bug or can be a new feature

Comments

@lovemianhuatang
Copy link

我开启了turms.service.message.use-conversation-id=true。

messageService.queryMessagesWithTotal 返回的total,好像只查询了第一条的Message的senderId。

const USER_ONE_ID = '999';
const USER_TWO_ID = '1000';

clientUserOne.messageService.queryMessagesWithTotal({
                fromIds: [targetId], // targetId=1000
                areGroupMessages: false
            })

clientUserTwo.messageService.queryMessagesWithTotal({
                fromIds: [targetId], // targetId=999
                areGroupMessages: false
            })
image

clientUserOne(userId=999)的total=0 符合预期吗?

@JamesChenX
Copy link
Member

If you don't call the method with maxCount, the param is set to 1 by default, you can set it to null explicitly, so turms-server will use the default max limit count set by the property turms.service.message.default-available-messages-number-with-total.

image

@JamesChenX JamesChenX added the question How to do something label Jun 26, 2024
@lovemianhuatang
Copy link
Author

我是想查total的总数,目前只会用第一条message的senderId来计算total,如果第一条是自己发送的,total就为0了;
预期应该要返回对方的给我发送的message total ,而不是自己的

@lovemianhuatang
Copy link
Author

@JamesChenX 我没传maxCount,maxCount使用的是默认的1,因为我只想查询消息的total
image
image

@lovemianhuatang
Copy link
Author

我的预期:
image
image

还有另外一个需求:total的计算希望能支持排除系统消息或召回消息的选项。

@JamesChenX JamesChenX added the status: confirming Confirming whether the issue is a bug or can be a new feature label Jun 29, 2024
@JamesChenX JamesChenX reopened this Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question How to do something status: confirming Confirming whether the issue is a bug or can be a new feature
Projects
None yet
Development

No branches or pull requests

2 participants