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] When calling getAdvancedHistoryMessageList in a group, it generates a large number of get_users_info requests #2831

Open
cipchk opened this issue Nov 4, 2024 · 10 comments
Assignees
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@cipchk
Copy link

cipchk commented Nov 4, 2024

OpenIM Server Version

3.8.1

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Docker Deployment

Bug Description and Steps to Reproduce

Here is the request code:

await OpenIM.iMManager.messageManager.getAdvancedHistoryMessageList(
      conversationID: conversationInfo.conversationID,
      count: 20,
      startMsg: _isFirstLoad ? null : messageList.firstOrNull,
      lastMinSeq: _isFirstLoad ? null : lastMinSeq,
    );

Requesting 20 records generates more than 40 get_users_info requests, see PNG:

image

This is the specific log of one of the requests and responses, and there are over 40 similar ones. The only difference is that they all have different userIDs:

I/GoLog   (30089): ]	[flutter/Android]                                 	[network/http_client.go:96]                       	ApiRequest                                        	{"operationID": "1730706607309", "url": "https://xxx.com/api/user/get_users_info", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiIxMDAwMCIsIlBsYXRmb3JtSUQiOjIsImV4cCI6MTczODA2MTgwMSwibmJmIjoxNzMwMjg1NTAxLCJpYXQiOjE3MzAyODU4MDF9.N6Qs5IFqiK8qAEOAFvxa96b3Sw8o9RBxyw89GRC-Jzs", "body": "{\"userIDs\":[\"10563\"]}"}
I/GoLog   (30089): ]	[flutter/Android]                                 	[network/http_client.go:131]                      	ApiResponse                                       	{"operationID": "1730706607309", "url": "https://xxx.com/api/user/get_users_info", "status": "200 OK", "body": "{\"errCode\":0,\"errMsg\":\"\",\"errDlt\":\"\",\"data\":{\"usersInfo\":[{\"userID\":\"10563\",\"nickname\":\"Натали\",\"faceURL\":\"\",\"ex\":\"\",\"createTime\":1725811767651,\"appMangerLevel\":0,\"globalRecvMsgOpt\":0}]}}"}

Screenshots Link

No response

@cipchk cipchk added the bug Categorizes issue or PR as related to a bug. label Nov 4, 2024
@cipchk
Copy link
Author

cipchk commented Nov 8, 2024

@icey-yu 有任何进展吗?因为这个情况导致我们现在都不敢让所有用户都使用 3.8.1 版本。

@OpenIM-Robot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@icey-yu Any progress? Because of this situation, we now dare not let all users use version 3.8.1.

@icey-yu
Copy link
Member

icey-yu commented Nov 11, 2024

We are investigating the issue.

@icey-yu
Copy link
Member

icey-yu commented Nov 11, 2024

In our tests, the SDK's interface calls are functioning normally. The logs you filtered may include entries from other calls. You can use the operationID to confirm if it’s from the same call.

@cipchk
Copy link
Author

cipchk commented Nov 11, 2024

@icey-yu Yes, they all share the same operationid, and I can confirm that it gets generated when calling getAdvancedHistoryMessageList.

Moreover, this issue is not limited to the Flutter side; it also applies to our Web side.

@icey-yu
Copy link
Member

icey-yu commented Nov 11, 2024

Is the conversation a group chat, and are most participants in the group non-friends?

@cipchk
Copy link
Author

cipchk commented Nov 11, 2024

@icey-yu Yes, over 99% of them are not friends with each other.

I created the group through https://doc.rentsoft.cn/zh-Hans/restapi/apis/groupManagement/createGroup, and all members were generated randomly. You can easily run the test.

@icey-yu
Copy link
Member

icey-yu commented Nov 11, 2024

We optimized this issue a few days ago. You can pull the latest code from the main branch of https://github.com/openimsdk/openim-sdk-core and try again.

@cipchk
Copy link
Author

cipchk commented Nov 11, 2024

Could you provide a specific PR related to optimization?

@icey-yu
Copy link
Member

icey-yu commented Nov 11, 2024

openimsdk/openim-sdk-core#765

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