Skip to content

fix: serialize organization role mutations#29

Merged
sionsmith merged 1 commit into
mainfrom
fix/serialize-organization-role-mutations-28
Jul 19, 2026
Merged

fix: serialize organization role mutations#29
sionsmith merged 1 commit into
mainfrom
fix/serialize-organization-role-mutations-28

Conversation

@sionsmith

Copy link
Copy Markdown
Contributor

Summary

  • serialize organization-role create, update, and delete requests per organization to prevent WorkOS priority-list races
  • preserve concurrency between different organizations and honor context cancellation while waiting
  • add HTTP-level concurrency regression coverage and a Terraform acceptance test matching the reported for_each scenario

Triage

This is a provider bug. Organization role mutations operate on an organization-scoped priority order, while Terraform creates independent role resources concurrently. The provider previously sent those mutations without coordination.

The fix uses organization-scoped serialization instead of retrying create requests. POST is not documented as idempotent, so an automatic retry could duplicate or incorrectly adopt a role after partial server-side success.

Testing

  • go test -race ./...
  • go vet ./...
  • go build ./...
  • go generate ./... (clean diff)
  • go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 run ./...
  • focused organization-role race tests passed 10 consecutive runs

A live WorkOS acceptance regression is included but was not run locally because WORKOS_API_KEY is not available in this environment.

Closes #28

@sionsmith
sionsmith merged commit 2313bb7 into main Jul 19, 2026
6 checks passed
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.

Concurrent organization role creation fails with “invalid priority list”

1 participant