[CHA-1578] refactor: code generated from openapi specs#71
Open
[CHA-1578] refactor: code generated from openapi specs#71
Conversation
There was a problem hiding this comment.
Pull request overview
This PR represents a comprehensive refactoring of the GetStream SDK, with code regenerated from refactored OpenAPI specifications. The changes primarily focus on improving type consistency, documentation, and API design across the feeds, chat, and video domains.
Key Changes
- Type System Refactoring: Separation of request/response types with consistent naming patterns (e.g.,
*Request,*Response,*Payloadsuffixes) - Model Consolidation: Removal of duplicate or deprecated types (e.g.,
Channel,Message,User,Poll,Banreplaced with dedicated response types) - API Method Updates: Renamed batch operations methods (
OwnCapabilitiesBatch→OwnBatch) and added new delete operations - Enhanced Documentation: Added comprehensive comments to events, request types, and response types
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
requests.go |
Renamed request types with consistent *Request and *Payload suffixes; added new fields and types for batch operations |
models.go |
Major refactoring: removed ~30 deprecated types, added ~50 new response types, enhanced event documentation, separated feeds/chat reaction types |
feeds.go |
Minor change with an unprofessional comment that needs removal |
feeds-v3.go |
Renamed OwnCapabilitiesBatch to OwnBatch, added DeleteFeedsBatch, updated DeleteFeedUserData endpoint from DELETE to POST |
feeds_test.go |
Updated tests to match renamed methods and added new test for DeleteFeedsBatch |
common_test.go |
Removed test skip statements for upload tests |
chat_test.go |
Removed test skip statements for upload tests |
chat.go |
Minor documentation update (duplicate event comment) |
call.go |
Reformatted imports to use grouped style |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
89c3330 to
05dad50
Compare
- GetReplies: pass empty Sort slice to avoid nil→"null" serialization - DeleteChannelType: sleep 6s + retry 5x (matching stream-chat-go) - QueryThreads: filter by channel_cid, fix CreatedByUserID assertion - UpdateApp: toggle EnforceUniqueUsernames instead of WebhookUrl - CreateGuest: handle disabled guest access with early return Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…issions, export, and more Tests cover: bans (global + channel), user mutes (with/without timeout), channel mutes, flagging (v2 moderation API), roles/permissions CRUD, channel export with async task, custom events, user restore after soft delete, member partial update, pending messages, and message history. All assertions match stream-chat-go test patterns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Messages need time to be indexed before they can be fetched in batch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive integration tests matching every implementable test from stream-chat-go, covering channels, messages, users, polls, bans, mutes, flags, permissions, threads, event hooks, delivery receipts, reminders, live location, shadow bans, and more. Also documents 7 codegen gaps where APIs exist in stream-chat-go but not in the generated SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…te, and permission tests - Regenerate all SDK files from chat backend with Ignore/Beta/ClientSideOnly flags removed (branch feature/cha-0-remove-openapi-ignore-flags) - New SDK methods: ChannelBatchUpdate, CreateDraft, QueryDrafts, QueryFlagReports, FlagReportReview, QueryTeamUsageStats, CreatePermission - Add TestChatDraftsIntegration (5 subtests: CRUD, thread, query, pagination) - Add TestChatChannelBatchUpdateIntegration (3 subtests: AddMembers, RemoveMembers, Archive) matching stream-chat-go polling/verification pattern - Add TestChatCreatePermissionIntegration (ListAndGetPermission passing, CreatePermission skipped due to codegen bug with path tag) - Fix multipart upload for UploadChannelFile/Image requests - Fix UndeleteMessageRequest usage after struct change (UndeletedBy field) - Update CODEGEN_GAPS.md documenting remaining codegen bugs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submit a pull request
CLA
Description of the pull request
Note
Medium Risk
Medium risk due to potentially breaking SDK surface changes (renamed methods and changed response types) plus broad new integration coverage and increased test parallelism/timeouts that may surface CI flakiness or rate-limit issues.
Overview
Updates generated SDK code to match latest OpenAPI specs, including a bug fix passing
callType/callIDtoCall.GetCallParticipantSessionMetricsand several Chat API signature adjustments (e.g.,ScheduleCampaignrenamed toStopCampaign, and message action/commit/translate/undelete now return more specific response types).Adds new API capabilities:
Chat.QueryTeamUsageStats, a full set of user group endpoints on the rootClient(List/Create/Search/Get/Update/Delete+ member add/remove), and new Feeds endpoints forUpdateActivitiesPartialBatch,QueryPinnedActivities, andRestoreFeedGroup; also removes the generatedChat.ChannelBatchUpdate.Expands coverage substantially with new Chat-focused integration tests (channels, messages, polls, reactions, users, user groups, webhooks, misc), adds an HTTP 429-retrying test client, and tweaks CI/dev workflow: pre-commit lint hook +
make setup-hooks, and CIgo testnow runs with higher parallelism and a longer timeout.Written by Cursor Bugbot for commit 947d49c. This will update automatically on new commits. Configure here.