Skip to content

fix(user-management): Make membership organization names optional - #1757

Open
workos-tars[bot] wants to merge 1 commit into
mainfrom
fix/optional-membership-organization-name
Open

workos-tars[bot] wants to merge 1 commit into
mainfrom
fix/optional-membership-organization-name

Conversation

@workos-tars

@workos-tars workos-tars Bot commented Nov 10, 2026

Copy link
Copy Markdown

Description

Organization membership events omit organization_name, but the SDK requires both the raw organization_name and deserialized organizationName to be strings. constructEvent() therefore returns undefined where its type promises a string, causing downstream runtime validators based on those types to reject valid events. Reproduced in published versions 12.0.0 and 12.2.0.

  • Make both fields optional in the existing shared membership interfaces, matching the backend's optional REST field and absent event/action field. This follows the existing optional user pattern without adding separate event models or changing runtime serialization.
  • Add six signed-webhook regression cases covering organization_membership.created, .updated, and .deleted, with and without the name. Typed input and expected-output fixtures protect both interfaces; present names are still preserved.
  • Keep webhook test additions inside the existing oagen-preserved section. The membership interface is hand-maintained and not in the generated-file manifest.

Type correction: consumers using this shared membership type must now handle a possibly absent name. Runtime behavior and API response contents are unchanged.

Validation

  • Before the interface fix, npm run typecheck fails on both new typed fixtures because the name may be absent; after the fix it passes.
  • Focused webhook, event, user-management, and action suites: 272 tests passed.
  • ESLint and Prettier on changed files passed.
  • npm run build passed, including declaration/package checks.
  • Full test/runtime matrices left to CI; no live customer requests or mutations.

Dependency installation reported existing audit findings (37 total, including 6 high); this PR changes no dependencies. Build completed despite informational bundler/package warnings.

Documentation

No public documentation change needed: this corrects SDK types to match existing payloads. Added a field comment explaining event/action omission.

Requested by kathleen.brandt@workos.com in Slack (TARS chain)

@workos-tars
workos-tars Bot requested review from a team as code owners November 10, 2026 20:21
@workos-tars
workos-tars Bot requested a review from Deborah-Digges November 10, 2026 20:21
@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Makes organizationName and organization_name optional to match existing membership payloads.

  • Membership names can be missing from webhook and action data.

Reviews (1) · Last reviewed commit: "fix(user-management): Make membership or..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants