[CHA-4634] feat: add getChannel API - #262
Conversation
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Verified against the endpoint it calls, no findings.
Adds
Channel.getChannel(type, id)forGET /channels/{type}/{id}. Bumble needs a read-only channel fetch on this SDK and is not moving to the generated SDK yet.Unlike
getOrCreatethe call never creates the channel. A missing channel returns 404, so it also works as an existence check. Options arestate,messagesLimit,membersLimitandwatchersLimit.The endpoint reads its options from a JSON
payloadquery parameter and returns 400 without one, so the request data is sent there instead of as flat query parameters. Same approach asqueryMembers.Verify:
ChannelTest.whenGettingExistingChannel_thenReturnsChannelandwhenGettingMissingChannel_thenNotFoundhit the live API.GetChannelTestasserts the request shape without network access.Linear: https://linear.app/stream/issue/CHA-4634/add-getchannel-api-to-the-old-java-sdk