Skip to content

fix(group): report a member the server dropped instead of claiming it was added - #257

Merged
tas50 merged 1 commit into
mainfrom
fix/group-member-add-reports-dropped
Sep 24, 2026
Merged

tas50 merged 1 commit into
mainfrom
fix/group-member-add-reports-dropped

Conversation

@tas50

@tas50 tas50 commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

erchef accepts a group PUT that names an actor it can't find. It silently drops that name, and it answers with the request body as sent. cinc group member add admins bob ghost --type client therefore printed:

Added bob, ghost to group "admins"

and exited 0, even though ghost never joined.

After an add, the command now reads the group back and splits the names it sent into the ones the group holds and the ones the server dropped. It reports only the members that were actually added, and fails naming any that were dropped:

Added bob to group "admins"
Error: the server didn't add ghost to group "admins". Check that a client by that name exists in this organization

remove is unchanged: removing a name that isn't in the group was already reported as "No change".

This wasn't noticed before because cinc-server-ng used to store unknown members, which kept the groups/member-unknown case gapped. v0.14.0 drops them the way erchef does (#255), which exposed the CLI side. This PR removes that gap.

Tests

  • TestGroupMemberAddReportsDroppedMembers uses a fake server that, like erchef, drops unknown names and echoes the request body.
  • The shared group test server now keeps what a PUT stored, so reading the group back sees it; the existing tests keep their meaning.
  • groups/member-unknown passes against cinc-server-ng v0.14.0 and is off the gap list.

… was added

erchef accepts a group PUT that names an actor it cannot find, silently
drops that name, and answers with the body as sent. group member add
therefore printed "Added bob, ghost to group ..." and exited 0 when the
ghost user never joined. After an add the command now reads the group
back, reports only the members it holds, and fails naming any the server
dropped so a typo or a missing actor is noticed.

Signed-off-by: Tim Smith <tsmith84@proton.me>
@tas50
tas50 merged commit 1dd90f0 into main Sep 24, 2026
6 checks passed
@tas50
tas50 deleted the fix/group-member-add-reports-dropped branch September 24, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant