Skip to content

[CHA-5958] feat: add history window team methods - #225

Merged
slavabobik merged 2 commits into
masterfrom
feat/cha-5958-history-window-teams
Oct 29, 2026
Merged

slavabobik merged 2 commits into
masterfrom
feat/cha-5958-history-window-teams

Conversation

@slavabobik

@slavabobik slavabobik commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Adds server-side methods for the chat history window team endpoints: mark teams as full history (the paid tier), unmark them, and list them. The endpoints are live and enabled per app by Stream; other apps get a StreamAPIException with code 17 (HTTP 403). Risk is low: the change only adds new methods, and existing calls are untouched.

Linear: https://linear.app/stream/issue/CHA-5958

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Method API
Client#set_history_window_teams(teams) POST /history_window/teams with {"teams": [...]} (1 to 10 unique teams); returns the marked teams with created_at and updated_at
Client#delete_history_window_teams(teams) POST /history_window/teams/delete with {"teams": [...]}; returns the teams that had full history
Client#get_history_window_teams GET /history_window/teams; returns default_window_hours and the teams with full history

All three are server-side only. On an app without the history window, the API answers 403 with code 17: history window teams are not allowed for this app, please contact support to enable it. The backend is GetStream/chat (CHA-5958); the endpoints are being added to the OpenAPI spec there too, so the generated getstream-ruby gets them as well.

Tests

spec/client_spec.rb, describe 'history window teams', two cases that each skip on the other kind of app:

  • App without the history window (the CI app): every call raises StreamAPIException with error_code 17 and a "history window teams" message.
  • App with it: mark a random team, list it, unmark it.

Run locally (Ruby 3.3 container):

  • bundle exec rake rubocop: no offenses.
  • bundle exec srb tc: no errors.
  • bundle exec rspec ./spec/client_spec.rb -e 'history window teams' against a staging app that has the history window: 2 examples, 0 failures. The round trip passed; the refusal case was pending, as expected on an enabled app.

Note

Low Risk
Additive SDK surface only; no changes to existing client behavior beyond new optional calls.

Overview
Adds three server-side Client methods for Stream’s chat history window team tier: grant teams full history (set_history_window_teams), revert them to the app default (delete_history_window_teams), and read default_window_hours plus the full-history team list (get_history_window_teams). Each wraps the existing post/get helpers with Sorbet signatures and YARD docs noting the 1–10 team limit and that apps without the feature get StreamAPIException code 17 (403).

Tests in spec/client_spec.rb probe the test app once via get_history_window_teams, then skip appropriately when endpoints are unrouted (code 16) or the feature is off/on. One example asserts all three calls are rejected with code 17 on disabled apps; the other runs mark → list → unmark on enabled apps.

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

Slava Bobik and others added 2 commits October 29, 2026 13:14
Client#set_history_window_teams, #delete_history_window_teams and
#get_history_window_teams call POST /history_window/teams,
POST /history_window/teams/delete and GET /history_window/teams: the paid
tier of the chat history window, enabled per app by Stream. Other apps get
a StreamAPIException with code 17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m yet

The CI app's region answers the history window endpoints with 404 code 16
until its edge control plane runs a release with them; that is deployment
state, not SDK behaviour, so both specs skip there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slavabobik
slavabobik force-pushed the feat/cha-5958-history-window-teams branch from 56241af to 9d7d155 Compare October 29, 2026 11:14
@slavabobik
slavabobik merged commit f581079 into master Oct 29, 2026
10 checks passed
@slavabobik
slavabobik deleted the feat/cha-5958-history-window-teams branch October 29, 2026 11:20
@slavabobik slavabobik mentioned this pull request Oct 29, 2026
slavabobik pushed a commit that referenced this pull request Oct 29, 2026
standard-version skipped both: their subjects start with a [CHA-...]
prefix, so they don't parse as conventional commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slavabobik slavabobik mentioned this pull request Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants