directory: fix /invite not re-inviting member who left owners' group#6866
Merged
Conversation
The /invite command's alreadyMember check treated any GroupMember row as a current member, including rows with status GSMemLeft or GSMemRemoved. Owners who had left the owners' group could therefore not be re-invited. Use memberCurrent to only block re-invite when the member is actually in the group.
d4f2b27 to
2e788be
Compare
…re-invite The owners' group has no GroupReg by design, so when an owner leaves it the directory service notifies admins with "Error: contact left, group: N owners, group registration not found" - expected behavior, but the test for re-inviting an owner who left the owners' group did not consume this DM and failed at bracket cleanup. The test also assumed bob's new invitation would land in #owners, but the chat client disambiguates it to #owners_1 because bob's old left membership of #owners is still present locally. Consume the admin DM explicitly and update the invitation assertions to #owners_1 / /j owners_1.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
/invitecommand in simplex-directory-service that incorrectly rejected re-inviting an owner who had left the owners' groupalreadyMembercheck at Service.hs:1123 was matching anyGroupMemberrow regardless ofmemberStatus; now usesmemberCurrentto only block re-invite for active memberstestInviteOwnerAfterLeavingOwnersGroupthat joins bob to#owners, leaves, then verifies/invitere-invites instead of erroringTest plan
cabal build simplex-directory-service(green)cabal test simplex-chat-test --test-option="-m" --test-option="re-invite"#owners, super-user sends/invite, confirm fresh invitation delivered