-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: reset user conversation seq when rejoining group to resolve message recall issue #3640
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
fix: reset user conversation seq when rejoining group to resolve message recall issue #3640
Conversation
I have read the CLA Document and I hereby sign the CLA |
|
I have read the CLA Document and I hereby sign the CLA |
|
|
Thank you very much for submitting this PR. |
|
One more note regarding the condition maxSeq <= 0: For now, keeping the value unified as 0 could help make the judgment logic more consistent across modules going forward. |
Hi @FGadvancer
|
📝 Description
This PR fixes a bug where members who quit and rejoin a group cannot recall their new messages or view new history correctly.
🐛 Issue
When a member quits a group, their
userMaxSeqis capped at the current groupmaxSeqto restrict access to future messages. However, when the user rejoins, thisuserMaxSeqlimit was not being cleared.As a result, new messages (which have a higher seq) are filtered out by the visibility logic, causing "RecordNotFoundError" errors on the server side and preventing operations like message recall.
💡 Solution
I implemented a mechanism to reset the conversation visibility for a user immediately after they successfully rejoin a group.
Specific changes:
setMemberJoinSeqininternal/rpc/group/group.go.minSeqtocurrentGroupMaxSeq + 1(ensuring they don't see messages from before they rejoined).userMaxSeqto0(removing the read limit so they can receive new messages).JoinGroup)InviteUserToGroup)GroupApplicationResponse)🔍 Verification
userMinSeqis correctly updated anduserMaxSeqis reset to 0 in the conversation settings.