Skip to content

feat: add channel and time filters to export users - #296

Merged
yaziine merged 1 commit into
mainfrom
feat/cha-6825-export-users-filters
Nov 30, 2026
Merged

yaziine merged 1 commit into
mainfrom
feat/cha-6825-export-users-filters

Conversation

@yaziine

@yaziine yaziine commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Ticket

CHA-6825

Problem

POST /export/users gained three optional filters (GetStream/chat #21994): channel_cids, messages_from and messages_to. They limit an export to some channels and a time window, for legal holds. ExportUsers.exportUsers cannot send them: ExportUsersRequestData only has user_ids.

Solution

ExportUsersRequest gets channelCids(List<String>), messagesFrom(Date) and messagesTo(Date), sent as channel_cids, messages_from and messages_to. Each is omitted when unset, so existing calls send the same request as before. Dates are Date, like messagesSince on channel export. DOCS.md gets an example.

The server owns the rules:

  • channel_cids: at most 100 well-formed CIDs; an empty list is a 400.
  • messages_from is inclusive, messages_to is exclusive, and messages_to must be after messages_from (otherwise 400).
  • Reactions are selected by the time they were added, in the same window. When any filter is set, calls are omitted from the export.

How to verify

  1. ./gradlew test --tests '*ExportUsersFiltersTest*' passes (2 tests, no API credentials needed). They assert the body carries all three fields when set and is only {"user_ids":[...]} when unset.
  2. ./gradlew spotlessCheck passes.

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested

🤖 Generated with Claude Code


Note

Low Risk
Additive SDK surface with backward-compatible serialization; scope is limited to export request bodies and tests.

Overview
Adds optional channel and time-window filters to ExportUsers.exportUsers, matching new POST /export/users parameters for legal-hold style exports.

The request builder now supports channelCids, messagesFrom, and messagesTo (serialized as channel_cids, messages_from, messages_to). Unset fields are omitted via @JsonInclude(NON_NULL), so existing integrations keep sending only user_ids. DOCS.md documents usage and server-side semantics (inclusive/exclusive bounds, reaction timing, calls omitted when any filter is set).

ExportUsersFiltersTest asserts JSON serialization when filters are set vs. omitted (no live API calls).

Reviewed by Cursor Bugbot for commit 36d71d3. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adityaalifn

Copy link
Copy Markdown
Contributor

/jeffery review

@getstream-metis

Copy link
Copy Markdown

Thanks for asking Jeffery for review. I'll stay on this PR until I can approve it.

How it works

  • Findings come as inline comments, each starting with [Must Fix], [Should Fix], nit: or consider:.
  • Push fixes whenever you're ready. Once the branch has been quiet for 10 minutes I review the new head and resolve the threads it fixes. To skip the wait, comment /jeffery review.
  • If you disagree or have a question, reply in the thread. I'll answer there, and resolve it if you're right.
  • I approve once every must-fix and should-fix is closed and nobody has requested changes. CI isn't part of that; branch protection still holds the merge until it's green. From round 3 on, open should-fix findings stop blocking.
  • I don't approve release/* branches or changes to protected paths, and I'll say so when that applies.
  • If a must-fix is still open after round 8, I stop and hand the PR to a human. Draft PRs wait until they're marked ready.

Commands (each as a whole comment)

Command What it does
/jeffery review Review the current head now
/jeffery rereview Start over at round 1 on the current head and withdraw my approval. This redoes the whole review and costs as much as the first one, so use it only when you don't trust the earlier rounds. If nothing changed since my last round I say so instead; add force to redo it anyway
/jeffery pause / /jeffery resume Stop or restart automatic reviews on this PR
/jeffery status What I last reviewed, and why I have or haven't approved
/jeffery help This list

/review-agent or a mention of me works in place of /jeffery.

@yaziine
yaziine enabled auto-merge (squash) November 30, 2026 13:18

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved 36d71d3c4a8d after 1 round

@yaziine
yaziine merged commit c51054f into main Nov 30, 2026
6 checks passed
@yaziine
yaziine deleted the feat/cha-6825-export-users-filters branch November 30, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants