Repository navigation
fix(user-management): Make membership organization names optional - #1757
Open
workos-tars[bot] wants to merge 1 commit into
Open
workos-tars[bot] wants to merge 1 commit into
workos-tars[bot] wants to merge 1 commit into
Conversation
Contributor
[Medium impact] This PR appears safe to merge. SummaryMakes
Reviews (1) · Last reviewed commit: "fix(user-management): Make membership or..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Organization membership events omit
organization_name, but the SDK requires both the raworganization_nameand deserializedorganizationNameto be strings.constructEvent()therefore returnsundefinedwhere 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.userpattern without adding separate event models or changing runtime serialization.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.Type correction: consumers using this shared membership type must now handle a possibly absent name. Runtime behavior and API response contents are unchanged.
Validation
npm run typecheckfails on both new typed fixtures because the name may be absent; after the fix it passes.npm run buildpassed, including declaration/package checks.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)