Skip to content

feat: add redaction, direction and soft-delete exclusions to export users - #298

Merged
yaziine merged 1 commit into
mainfrom
feat/export-users-redact-and-direction
Dec 1, 2026
Merged

yaziine merged 1 commit into
mainfrom
feat/export-users-redact-and-direction

Conversation

@yaziine

@yaziine yaziine commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Ticket

CHA-6826, CHA-6827

Problem

POST /export/users gained five optional fields:

  • redact_ids and redact_salt (GetStream/chat #22200)
  • direction, exclude_soft_deleted_messages and exclude_soft_deleted_channels (GetStream/chat #22244)

ExportUsers.exportUsers can't send them: ExportUsersRequestData only has user_ids and the filters from #296.

Solution

ExportUsersRequest gets five builder methods:

  • redactIds(Boolean) and redactSalt(String)
  • direction(String): "sent" (default) or "sent_and_received"
  • excludeSoftDeletedMessages(Boolean) and excludeSoftDeletedChannels(Boolean)

Each is omitted when unset, so existing calls send the same request as before. direction is a plain String, like other string options in this SDK. DOCS.md gets an example.

The server owns the rules:

  • redact_ids requires redact_salt (at most 255 characters) and exactly one user ID. redact_salt without redact_ids is a 400.
  • direction must be sent or sent_and_received. sent_and_received requires exactly one user ID.
  • exclude_soft_deleted_channels defaults to false. The channel export's include_soft_deleted_channels has the opposite default.

Callers should only use these fields once the chat release with both server PRs is deployed. An older server ignores them.

How to verify

  1. ./gradlew test --tests '*ExportUsersFiltersTest*' passes: 3 tests, no API credentials needed. They assert the body carries all five new fields when set and is only {"user_ids":[...]} when unset. I ran it in amazoncorretto:11.
  2. ./gradlew spotlessApply made no further changes.

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
Backward-compatible SDK surface and request serialization only; validation and export behavior remain on the server.

Overview
Extends ExportUsers.exportUsers so the Java SDK can send five new optional POST /export/users fields that the API already supports.

ExportUsersRequestData gains builder-backed options mapped with @JsonInclude(NON_NULL): redactIds / redactSalt for deterministic placeholder IDs, direction (sent or sent_and_received), and excludeSoftDeletedMessages / excludeSoftDeletedChannels. Unset values are omitted from the JSON body, so existing callers still emit only user_ids (and any filters they already used).

DOCS.md documents a single-user export example combining direction, redaction, and soft-delete flags. ExportUsersFiltersTest adds coverage that all five fields serialize correctly when set.

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

…sers

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

getstream-metis Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

👋 Thanks, Yassine! I'm on it.

How to work with me

  • 💬 Disagree with a finding? Reply in its thread and tell me why. I'll withdraw it, or answer with evidence.
  • 🔁 Fixed it? Just push. The next round checks your fix and resolves the thread.
  • 👍 👎 Rate my findings. I learn what your team doesn't want flagged.
  • ✅ I approve once nothing blocking is left: must-fix always blocks, should-fix only in the first two rounds. CI isn't part of that; branch protection still holds the merge until it's green. On repos that require a human approval, a teammate still has to approve too.
Commands

Comment any of these on the PR:

  • /jeffery review · start a review
  • /jeffery next-round · start the next round now
  • /jeffery pause · /jeffery resume · stop or restart reviews on this PR
  • /jeffery status · where things stand
  • /jeffery help · all commands

@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.

Round 1 · 🎉 Approved

Nice work, Yassine! Nothing blocking is left on 132189263b14. Ship it 🚀

@yaziine
yaziine merged commit b8395b5 into main Dec 1, 2026
7 checks passed
@yaziine
yaziine deleted the feat/export-users-redact-and-direction branch December 1, 2026 15:58
@yaziine yaziine mentioned this pull request Dec 1, 2026
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.

1 participant