feat(workspace-users): exclude removed users by default#13
Open
scottlovegrove wants to merge 2 commits into
Open
feat(workspace-users): exclude removed users by default#13scottlovegrove wants to merge 2 commits into
scottlovegrove wants to merge 2 commits into
Conversation
`getWorkspaceUsers` now excludes users with `removed: true` by default; pass `includeRemoved: true` to include them. The Comms API's `workspace_users/get` always returns removed users with no override param, so the filtering happens client-side in the SDK. Ported from Doist/twist-sdk-typescript#138. Unlike the twist SDK, comms has no batch path, so the filter applies only to the awaited call. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
reviewed
May 22, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
This PR updates getWorkspaceUsers to filter out removed users client-side by default, smoothly porting the desired behavior from the Twist SDK. The implementation handles the API's lack of server-side filtering well while maintaining a clean interface with the new includeRemoved argument. A couple of minor adjustments were noted, specifically filtering the raw response data prior to Zod validation to reduce overhead, and adding query-parameter assertions to the tests to secure the intended wire contract.
- Filter removed users out of the raw response before Zod parsing, so discarded users don't incur validation overhead. - Assert no server-side filter param on the `includeRemoved: true` path too, locking in the client-side-only wire contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Port of Doist/twist-sdk-typescript#138 to comms-sdk.
getWorkspaceUsersnow excludes users withremoved: trueby default; passincludeRemoved: trueto include them.workspace_users/getalways returns removed users and exposes no override param, so the filtering happens client-side in the SDK.GetWorkspaceUsersArgsgains an optionalincludeRemoved?: boolean(defaults tofalse).Difference from the twist PR
twist-sdk applies the filter to both an awaited path and a batch-descriptor path (via a new
transformhook onBatchRequestDescriptor). comms-sdk has no batch pattern, so the filter applies only to the awaited call — no batch plumbing needed.Test plan
include_removed/with_removedquery param (proves client-side filtering)includeRemoved: truereturns all usersnpm run type-checkcleannpm run check(oxlint + oxfmt) cleannpm test— 128 pass (+2 new)🤖 Generated with Claude Code