Skip to content

[CHA-4634] feat: add getChannel API - #262

Merged
mogita merged 1 commit into
mainfrom
feat/cha-4634-get-channel
Aug 11, 2026
Merged

[CHA-4634] feat: add getChannel API#262
mogita merged 1 commit into
mainfrom
feat/cha-4634-get-channel

Conversation

@mogita

@mogita mogita commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Adds Channel.getChannel(type, id) for GET /channels/{type}/{id}. Bumble needs a read-only channel fetch on this SDK and is not moving to the generated SDK yet.

Unlike getOrCreate the call never creates the channel. A missing channel returns 404, so it also works as an existence check. Options are state, messagesLimit, membersLimit and watchersLimit.

The endpoint reads its options from a JSON payload query parameter and returns 400 without one, so the request data is sent there instead of as flat query parameters. Same approach as queryMembers.

Verify: ChannelTest.whenGettingExistingChannel_thenReturnsChannel and whenGettingMissingChannel_thenNotFound hit the live API. GetChannelTest asserts the request shape without network access.

Linear: https://linear.app/stream/issue/CHA-4634/add-getchannel-api-to-the-old-java-sdk

Adds Channel.getChannel(type, id), which calls GET /channels/{type}/{id}.
Unlike getOrCreate it never creates the channel: a missing channel returns
404, so the request also works as an existence check.

The endpoint reads its options from a JSON `payload` query parameter and
returns 400 without one, so the request data is sent there.

@adityaalifn adityaalifn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checked the SDK against the endpoint it calls. payload is not optional there: ParseAndValidateURLWithPayload (chat monolith/internal/validator/validate.go:260-263) returns ErrMissingPayload when the query parameter is empty, so flat query parameters alone would 400 and the comment in ChannelService is accurate.

The four field names match the server's JSON tags (state, messages_limit, members_limit, watchers_limit), the 404 comes from ChannelOr404 in the controller rather than anything SDK-side, and the endpoint has been on chat master since 2026-07-08 (v234.3.0), so it is deployed well ahead of this. No findings.

@adityaalifn adityaalifn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified against the endpoint it calls, no findings.

@mogita
mogita merged commit cbe2124 into main Aug 11, 2026
5 checks passed
@mogita
mogita deleted the feat/cha-4634-get-channel branch August 11, 2026 08:11
@github-actions github-actions Bot mentioned this pull request Aug 11, 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