Skip to content

[CHA-2585] add migration guide from stream-chat-ruby#37

Open
mogita wants to merge 1 commit intomasterfrom
cha-2585_migration-docs
Open

[CHA-2585] add migration guide from stream-chat-ruby#37
mogita wants to merge 1 commit intomasterfrom
cha-2585_migration-docs

Conversation

@mogita
Copy link
Collaborator

@mogita mogita commented Mar 9, 2026

No description provided.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 9, 2026 09:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a comprehensive migration guide for users transitioning from the stream-chat-ruby SDK to the new getstream-ruby SDK. The guide is organized into a main README with an overview and six topic-specific sub-guides covering setup/auth, users, channels, messages/reactions, moderation, and devices. A link to the migration guide is also added to the main project README.

Changes:

  • Added a main migration guide README (docs/migration-from-stream-chat-ruby/README.md) with a high-level comparison table and a quick before/after example
  • Added six topic-specific migration guides (01 through 06) with side-by-side code examples for every common operation
  • Updated the project README.md to link to the new migration guide

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
README.md Added a "Migrating from stream-chat-ruby?" section with a link to the migration guide
docs/migration-from-stream-chat-ruby/README.md Main migration overview with key differences table, quick example, and links to sub-guides
docs/migration-from-stream-chat-ruby/01-setup-and-auth.md Setup, client instantiation, env vars, and token generation migration guide
docs/migration-from-stream-chat-ruby/02-users.md User operations migration guide (upsert, query, partial update, deactivate, delete)
docs/migration-from-stream-chat-ruby/03-channels.md Channel operations migration guide (create, query, members, update, delete)
docs/migration-from-stream-chat-ruby/04-messages-and-reactions.md Messages and reactions migration guide (send, get, update, delete, reactions)
docs/migration-from-stream-chat-ruby/05-moderation.md Moderation operations migration guide (ban, unban, mute, shadow ban, moderators)
docs/migration-from-stream-chat-ruby/06-devices.md Device management migration guide (add, list, delete devices)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


client = GetStreamRuby.manual(api_key: 'STREAM_KEY', api_secret: 'STREAM_SECRET')

response = client.chat.delete_reaction(message_id, 'like', user_id: 'bob-1')
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The delete_reaction method in the actual SDK uses a positional parameter for user_id, not a keyword argument. The method signature is def delete_reaction(_id, _type, user_id = nil) (see lib/getstream_ruby/generated/chat_client.rb:1045). Using user_id: 'bob-1' (keyword syntax) would pass a hash as the third positional argument. The example should use client.chat.delete_reaction(message_id, 'like', 'bob-1') instead.

Copilot uses AI. Check for mistakes.
Comment on lines +352 to +355
| Hard delete | `client.hard_delete_message(id)` | `client.chat.delete_message(id, hard: true)` |
| Send reaction | `chan.send_reaction(msg_id, hash, uid)` | `client.chat.send_reaction(msg_id, SendReactionRequest)` |
| Get reactions | `chan.get_reactions(msg_id)` | `client.chat.get_reactions(msg_id)` |
| Delete reaction | `chan.delete_reaction(msg_id, type, uid)` | `client.chat.delete_reaction(msg_id, type, user_id:)` |
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The summary table entries for "Hard delete" and "Delete reaction" use keyword argument syntax (hard: true, user_id:) but the actual SDK methods use positional parameters. delete_message is def delete_message(_id, hard = nil, ...) and delete_reaction is def delete_reaction(_id, _type, user_id = nil). These should show positional arguments instead.

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +124
response = client.common.list_devices(user_id: 'jane-1')
devices = response['devices']
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The list_devices method in the actual SDK uses a positional parameter, not a keyword argument. The method signature is def list_devices(user_id = nil) (see lib/getstream_ruby/generated/common_client.rb:217). Calling it with user_id: 'jane-1' (keyword syntax) on Ruby 3.3 would pass a hash {user_id: 'jane-1'} as the positional argument instead of the string 'jane-1', leading to incorrect behavior. The example should use client.common.list_devices('jane-1') instead.

Copilot uses AI. Check for mistakes.

client = GetStreamRuby.manual(api_key: 'STREAM_KEY', api_secret: 'STREAM_SECRET')

client.common.delete_device('apns-device-token', user_id: 'jane-1')
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The delete_device method in the actual SDK uses positional parameters, not keyword arguments. The method signature is def delete_device(_id, user_id = nil) (see lib/getstream_ruby/generated/common_client.rb:198). Calling it with user_id: 'jane-1' (keyword syntax) on Ruby 3.3 would pass a hash as the positional argument instead of the string value. The example should use client.common.delete_device('apns-device-token', 'jane-1') instead.

Copilot uses AI. Check for mistakes.

client = GetStreamRuby.manual(api_key: 'STREAM_KEY', api_secret: 'STREAM_SECRET')

client.chat.delete_channel('messaging', 'general', hard_delete: false)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The delete_channel method in the actual SDK uses a positional parameter, not a keyword argument. The method signature is def delete_channel(_type, _id, hard_delete = nil) (see lib/getstream_ruby/generated/chat_client.rb:213). Using hard_delete: false (keyword syntax) on Ruby 3.3 would pass a hash {hard_delete: false} as the positional argument instead of the boolean value. The example should use client.chat.delete_channel('messaging', 'general', false) instead.

Copilot uses AI. Check for mistakes.
Comment on lines +139 to +171
client = GetStreamRuby.manual(api_key: 'STREAM_KEY', api_secret: 'STREAM_SECRET')
token = client.create_token('bob-1')
```

**Key changes:**
- Method name is the same (`create_token`), only the client initialization differs

### Token With Expiration

**Before (stream-chat-ruby):**

```ruby
require 'stream-chat'

client = StreamChat::Client.new('STREAM_KEY', 'STREAM_SECRET')

# Expiration and issued-at are Unix timestamps
token = client.create_token(
'bob-1',
exp: (Time.now + 3600).to_i,
iat: Time.now.to_i,
)
```

**After (getstream-ruby):**

```ruby
require 'getstream_ruby'

client = GetStreamRuby.manual(api_key: 'STREAM_KEY', api_secret: 'STREAM_SECRET')

# Expiration is a duration in seconds (relative, not absolute)
token = client.create_token('bob-1', expiration: 3600)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The create_token method does not exist on the GetStreamRuby::Client class. I searched the entire lib/ directory and found no method definition matching create_token or any token-generation method. The migration guide shows client.create_token('bob-1') and client.create_token('bob-1', expiration: 3600) as valid new SDK calls, but these methods are not implemented. Either this section documents a method that hasn't been added yet, or the method name/location is different. Please verify and update these examples to match the actual SDK API.

Copilot uses AI. Check for mistakes.
| Remove members | `chan.remove_members(user_ids)` | `client.chat.update_channel(type, id, UpdateChannelRequest(remove_members:))` |
| Full update | `chan.update(data)` | `client.chat.update_channel(type, id, UpdateChannelRequest)` |
| Partial update | `chan.update_partial(set:, unset:)` | `client.chat.update_channel_partial(type, id, UpdateChannelPartialRequest)` |
| Delete channel | `chan.delete` | `client.chat.delete_channel(type, id, hard_delete:)` |
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The summary table entry for "Delete channel" shows hard_delete: as a keyword argument, but the actual method signature is def delete_channel(_type, _id, hard_delete = nil) with a positional parameter. This should be client.chat.delete_channel(type, id, hard_delete) without the colon.

Suggested change
| Delete channel | `chan.delete` | `client.chat.delete_channel(type, id, hard_delete:)` |
| Delete channel | `chan.delete` | `client.chat.delete_channel(type, id, hard_delete)` |

Copilot uses AI. Check for mistakes.
Comment on lines +162 to +163
| List devices | `client.get_devices(uid)` | `client.common.list_devices(user_id:)` |
| Delete device | `client.remove_device(id, uid)` | `client.common.delete_device(id, user_id:)` |
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

Consistent with the issues in the code examples above, the summary table entries for "List devices" and "Delete device" show keyword argument syntax (user_id:) but the actual SDK methods use positional parameters. Should be client.common.list_devices(uid) and client.common.delete_device(id, uid) respectively.

Copilot uses AI. Check for mistakes.
client.chat.delete_message(message_id)

# Hard delete
client.chat.delete_message(message_id, hard: true)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The delete_message method in the actual SDK uses a positional parameter, not a keyword argument. The method signature is def delete_message(_id, hard = nil, deleted_by = nil, delete_for_me = nil) (see lib/getstream_ruby/generated/chat_client.rb:880). Using hard: true (keyword syntax) on Ruby 3.3 would pass a hash {hard: true} as the positional argument instead of the boolean. The example should use client.chat.delete_message(message_id, true) instead.

Suggested change
client.chat.delete_message(message_id, hard: true)
client.chat.delete_message(message_id, true)

Copilot uses AI. Check for mistakes.

client = GetStreamRuby.manual(api_key: 'STREAM_KEY', api_secret: 'STREAM_SECRET')

response = client.chat.get_reactions(message_id, limit: 10, offset: 0)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The get_reactions method in the actual SDK uses positional parameters, not keyword arguments. The method signature is def get_reactions(_id, limit = nil, offset = nil) (see lib/getstream_ruby/generated/chat_client.rb:1068). Using limit: 10, offset: 0 (keyword syntax) would pass a hash as the second positional argument. The example should use client.chat.get_reactions(message_id, 10, 0) instead.

Copilot uses AI. Check for mistakes.
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