feat: optimize fresh device conversation sync#3740
Open
redflyingfish wants to merge 1 commit into
Open
Conversation
Contributor
|
💕 Thank you for your contribution and please kindly read and sign our CLA. CLA Docs I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Author
|
Hi maintainers, the CLA Assistant link currently returns 404 for me, so I cannot complete the CLA signature from the provided link. Could you please check the CLA configuration or provide the correct signing URL? Also, the current CI failure is expected because this server PR depends on openimsdk/protocol#203, and the official protocol version used by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🅰 Please add the issue ID after "Fixes #"
Fixes #3496
Depends on openimsdk/protocol#203.
Summary
This PR optimizes fresh device conversation sync for users with a large number of conversations.
When a fresh device logs in with
idHash = 0, the server currently returns all owner conversation IDs. For users with many historical conversations, this can produce a very large sync response and trigger expensive follow-up sync work.This change:
GetFullOwnerConversationIDs;userMinSeq;Protocol dependency
This PR requires the protocol additions from openimsdk/protocol#203:
GetFullOwnerConversationIDsReq.paginationGetFullOwnerConversationIDsResp.totalGetConversationsFullSyncSeqsFullSyncSeqs.userMinSeqUntil openimsdk/protocol#203 is merged and released, CI builds that use the current official protocol version may fail with missing
GetConversationsFullSyncSeqstypes/methods.After the protocol PR is merged and released, this PR should bump
github.com/openimsdk/protocolto the corresponding version.Testing
Tested locally with
github.com/openimsdk/protocolreplaced by the protocol branch from openimsdk/protocol#203:go test -mod=mod ./internal/rpc/conversation ./internal/rpc/msg ./pkg/rpcli ./pkg/common/storage/controller ./pkg/common/storage/model