Repository navigation
feat: add exclude_channel_cids to delete many users - #293
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adityaalifn
approved these changes
Nov 25, 2026
Merged
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.
Ticket
CHA-6824
Problem
POST /users/deletegained an optionalexclude_channel_cidslist (GetStream/chat #21218, live on every chat release since v241.18.x). Channels in the list keep the deleted users' messages, memberships, thread participation and reactions, and are not deleted as conversations. It is meant for legal holds.User.deleteManycannot send it:UserDeleteManyRequestDataonly hasuser_ids,user,messagesandconversations.Solution
UserDeleteManyRequest.excludeChannelCids(List<String>)sendsexclude_channel_cidsin the request body. The field is omitted when unset, so existing calls send the same request as before.DOCS.mdgets an example.The server owns the rules: at most 1000 entries, duplicates included; a 400 with a hard user delete strategy, with
files, or for a malformed CID; a well-formed CID that does not exist excludes nothing.How to verify
./gradlew test --tests '*UserDeleteManyExcludeChannelsTest*'passes (2 tests, no API credentials needed). They assert the body carriesexclude_channel_cidswhen set and omits it when unset../gradlew spotlessCheckpasses.CLA
🤖 Generated with Claude Code
Note
Medium Risk
Touches user deletion request payloads; wrong usage could leave unexpected data or fail deletes, but the change is additive and backward compatible when the field is unset.
Overview
Adds support for the Chat API’s
exclude_channel_cidsoption on bulk user delete so callers can preserve specific channels (e.g. legal holds) when soft-deleting users.User.deleteManynow acceptsexcludeChannelCids(List<String>), which serializes toexclude_channel_cidswhen set and stays omitted for unchanged requests. Documented limits: at most 1000 CIDs; not valid with a hard user delete strategy (enforced by the API).DOCS.mdincludes a new example chaining soft user delete, hard message/conversation delete, and channel exclusion.UserDeleteManyExcludeChannelsTestasserts JSON serialization includes or omits the field without live API calls.Reviewed by Cursor Bugbot for commit f11a279. Bugbot is set up for automated code reviews on this repo. Configure here.