fix: return ActionRequiredResult for org invites instead of SuccessResult#139
fix: return ActionRequiredResult for org invites instead of SuccessResult#139
Conversation
…sult CreateAccount was returning SuccessResult when sending a GitHub org invite, but the user hasn't actually joined yet — they must accept the invitation first. This caused downstream team membership grants to fail. Now returns the correct response type for each case: - New invite sent: ActionRequiredResult (pending acceptance) - Already an org member: AlreadyExistsResult - Already has pending invite: ActionRequiredResult Ref: IGA-1311 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @highb's task in 1m 4s —— View job PR Review: Return ActionRequiredResult for org invites
Overall: This is a clean, well-scoped fix. The change correctly addresses the semantic mismatch where What changed
FeedbackLooks good — no blocking issues. A few observations:
LGTM — this is a well-targeted fix for the root cause described in the PR summary. The C1 engine will no longer treat an invitation as a completed account creation, which should resolve the downstream team membership grant failures. |
| }) | ||
| if err != nil { | ||
| if isAlreadyOrgMemberError(err, resp) { | ||
| return &v2.CreateAccountResponse_AlreadyExistsResult{}, nil, nil, nil |
There was a problem hiding this comment.
I think you need to return the resource as part of the response so c1 caches this value?
Summary
CreateAccountnow returnsActionRequiredResult(notSuccessResult) when sending a GitHub org invite, since the user must accept the invitation before they're an org memberAlreadyExistsResultwhen the user is already an org member (422 "already a member")ActionRequiredResultwhen a pending invite already exists (422 "already invited")Fixes the root cause of downstream team membership grants failing with "only users can be granted team membership" — the C1 engine was treating the invite as a completed account creation.
Closes: IGA-1311 baton-github: Return ActionRequiredResult for org invites
Test plan
go build ./...passesgo vet ./...passesActionRequiredResultwith resource and messageAlreadyExistsResultActionRequiredResultwith pending messageActionRequiredResultcorrectly (behind feature flag, tracked in IGA-1212)🤖 Generated with Claude Code