Skip to content

directory: fix /invite not re-inviting member who left owners' group#6866

Merged
epoberezkin merged 3 commits into
masterfrom
nd/fix-directory-invite
Apr 29, 2026
Merged

directory: fix /invite not re-inviting member who left owners' group#6866
epoberezkin merged 3 commits into
masterfrom
nd/fix-directory-invite

Conversation

@Narasimha-sc
Copy link
Copy Markdown
Collaborator

@Narasimha-sc Narasimha-sc commented Apr 22, 2026

Summary

  • Fix /invite command in simplex-directory-service that incorrectly rejected re-inviting an owner who had left the owners' group
  • alreadyMember check at Service.hs:1123 was matching any GroupMember row regardless of memberStatus; now uses memberCurrent to only block re-invite for active members
  • Add regression test testInviteOwnerAfterLeavingOwnersGroup that joins bob to #owners, leaves, then verifies /invite re-invites instead of erroring

Test plan

  • cabal build simplex-directory-service (green)
  • cabal test simplex-chat-test --test-option="-m" --test-option="re-invite"
  • Manual: bob joins then leaves #owners, super-user sends /invite, confirm fresh invitation delivered

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.
@Narasimha-sc Narasimha-sc force-pushed the nd/fix-directory-invite branch from d4f2b27 to 2e788be Compare April 22, 2026 16:05
…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.
@Narasimha-sc Narasimha-sc changed the title directory: re-invite owner who left owners' group directory: re-invite group owner who left owners' group Apr 23, 2026
@Narasimha-sc Narasimha-sc changed the title directory: re-invite group owner who left owners' group directory: fix /invite not re-inviting member who left owners' group Apr 23, 2026
@epoberezkin epoberezkin merged commit fd14739 into master Apr 29, 2026
8 of 12 checks passed
@epoberezkin epoberezkin deleted the nd/fix-directory-invite branch April 29, 2026 09:40
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants