Skip to content

feat!: add GetChannel endpoint#271

Open
mogita wants to merge 2 commits into
mainfrom
feat/cha-3741-add-getchannel-endpoint
Open

feat!: add GetChannel endpoint#271
mogita wants to merge 2 commits into
mainfrom
feat/cha-3741-add-getchannel-endpoint

Conversation

@mogita

@mogita mogita commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Regenerates the SDK from the current API spec. Adds the read-only GetChannel endpoint:

  • client.chat.get_channel(type, id, state=..., messages_limit=..., members_limit=..., watchers_limit=...) fetches a channel by CID without creating it (404 if it does not exist). Returns ChannelStateResponse. Sync and async variants, plus a channel.get_channel(...) wrapper.

Breaking changes

Regeneration also syncs accumulated spec drift. Two ModerationSettings fields are removed because they are no longer in the API spec:

  • analyze_max_image_size_bytes
  • webhook_header_client_request_id_key

These had no server-side binding and were non-functional, so removing them has no runtime impact, but it is source-breaking for code referencing them. Warrants a major version bump at release.

Test plan

  • import getstream OK; ruff check/ruff format clean.
  • Non-integration tests: +2 passing (the new get_channel tests), no new failures vs base (pre-existing local-only failures are env/CI-dependent).
  • Integration tests run in CI.

Summary by CodeRabbit

  • New Features
    • Added channel retrieval with configurable state, message, member, and watcher limits.
    • Added feeds APIs for batch reaction queries and activity share queries.
    • Added support for targeting feeds when adding reactions.
    • Added moderation queue management: list, create, retrieve, update, and delete queues.
    • Added AI audio moderation configuration and expanded moderation settings.
    • Added support for review-queue export webhook events.
  • Enhancements
    • Added feed audit log configuration support.
    • Expanded reaction, sharing, OCR, and moderation response data.

Regenerate SDK from the current API spec. Adds the read-only get_channel
endpoint (sync and async) returning ChannelStateResponse, plus the
channel.get_channel(...) wrapper.

BREAKING CHANGE: removes 2 ModerationSettings fields (analyze_max_image_size_bytes, webhook_header_client_request_id_key) no longer present in the API spec. They had no server-side binding and were non-functional; no runtime impact.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds chat channel retrieval, feed reaction/share APIs, moderation queue management, expanded moderation and app configuration models, and review-queue export webhook parsing for synchronous and asynchronous clients.

Changes

Chat channel retrieval

Layer / File(s) Summary
Channel retrieval flow
getstream/chat/channel.py, getstream/chat/async_channel.py, getstream/chat/rest_client.py, getstream/chat/async_rest_client.py
Adds synchronous and asynchronous Channel.get methods and chat REST client calls for channel state retrieval with optional limits and state selection.

Feeds reactions and shares

Layer / File(s) Summary
Reaction and share contracts
getstream/models/__init__.py
Adds batch reaction request/response models, share response models, latest-share fields, target-feed fields, and asynchronous reaction notification fields.
Reaction and share endpoint wiring
getstream/feeds/rest_client.py
Adds batch reaction queries, activity share queries, and target-feed forwarding for activity and comment reactions.

Moderation and platform updates

Layer / File(s) Summary
Configuration and application settings
getstream/common/*rest_client.py, getstream/moderation/*rest_client.py, getstream/models/__init__.py
Adds AI audio configuration, moderation settings, OCR-related fields, feed audit-log configuration, and application update support.
Moderation queue contracts and endpoints
getstream/moderation/*rest_client.py, getstream/models/__init__.py
Adds queue request/response models and list, create, get, update, and delete client methods.
Moderation payload and permission schemas
getstream/models/__init__.py
Extends moderation payload content, ordering, identifiers, dashboard preferences, permissions, filters, and OCR rule parameters.
Review-queue export webhook parsing
getstream/webhook.py, getstream/models/__init__.py, getstream/tests/test_webhook.py
Adds review-queue export event models, dispatch constants, parser mappings, and conformance tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ModerationRestClient
  participant ModerationQueueAPI
  Client->>ModerationRestClient: create_queue(name, type, filters)
  ModerationRestClient->>ModerationQueueAPI: POST /moderation/queues
  ModerationQueueAPI-->>ModerationRestClient: QueueResponse
  ModerationRestClient-->>Client: StreamResponse[QueueResponse]
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly names the main feature added: the GetChannel endpoint.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cha-3741-add-getchannel-endpoint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@getstream/chat/async_channel.py`:
- Around line 34-52: Expose the promised get_channel API on both Channel
wrappers: rename or alias the async Channel.get method in
getstream/chat/async_channel.py lines 34-52 and the sync Channel.get method in
getstream/chat/channel.py lines 34-52 as get_channel, while preserving existing
get compatibility if needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7e79265-4d27-4eae-95ef-4c03c1827bc5

📥 Commits

Reviewing files that changed from the base of the PR and between f552d7e and 7892480.

📒 Files selected for processing (12)
  • getstream/chat/async_channel.py
  • getstream/chat/async_rest_client.py
  • getstream/chat/channel.py
  • getstream/chat/rest_client.py
  • getstream/common/async_rest_client.py
  • getstream/common/rest_client.py
  • getstream/feeds/rest_client.py
  • getstream/models/__init__.py
  • getstream/moderation/async_rest_client.py
  • getstream/moderation/rest_client.py
  • getstream/tests/test_webhook.py
  • getstream/webhook.py

Comment on lines +34 to +52
@attach_channel_cid_async
async def get(
self,
state: Optional[bool] = None,
messages_limit: Optional[int] = None,
members_limit: Optional[int] = None,
watchers_limit: Optional[int] = None,
) -> StreamResponse[ChannelStateResponse]:
response = await self.client.get_channel(
type=self.channel_type,
id=self.channel_id,
state=state,
messages_limit=messages_limit,
members_limit=members_limit,
watchers_limit=watchers_limit,
)
self._sync_from_response(response.data)
return response

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Align both channel wrappers with the promised get_channel API.

The REST clients correctly expose get_channel, but both public Channel wrappers are named get, so channel.get_channel(...) is unavailable.

  • getstream/chat/async_channel.py#L34-L52: rename the async get method to get_channel, or add a compatibility alias.
  • getstream/chat/channel.py#L34-L52: rename the sync get method to get_channel, or add a compatibility alias.
📍 Affects 2 files
  • getstream/chat/async_channel.py#L34-L52 (this comment)
  • getstream/chat/channel.py#L34-L52
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getstream/chat/async_channel.py` around lines 34 - 52, Expose the promised
get_channel API on both Channel wrappers: rename or alias the async Channel.get
method in getstream/chat/async_channel.py lines 34-52 and the sync Channel.get
method in getstream/chat/channel.py lines 34-52 as get_channel, while preserving
existing get compatibility if needed.

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.

1 participant