From 08101d6224560bbb5757af4adbbaa6ed1233fc1b Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:38:08 +0200 Subject: [PATCH 01/10] feat(llc)!: add standalone file/image upload/remove methods This change introduces new methods to the `StreamChatClient` and `AttachmentFileUploader` for managing standalone file and image uploads and removals. Specifically, the following methods have been added: - `StreamChatClient.uploadImage`: Uploads an image to the Stream CDN. - `StreamChatClient.uploadFile`: Uploads a file to the Stream CDN. - `StreamChatClient.removeImage`: Removes an image from the Stream CDN. - `StreamChatClient.removeFile`: Removes a file from the Stream CDN. These methods are also implemented in the `AttachmentFileUploader` interface and its default implementation `StreamAttachmentFileUploader`. Additionally, new response types `UploadImageResponse` and `UploadFileResponse` have been added, aliasing `SendAttachmentResponse`. --- .../stream_chat/lib/src/client/client.dart | 62 ++++++++++ .../core/api/attachment_file_uploader.dart | 106 ++++++++++++++++++ .../lib/src/core/api/responses.dart | 6 + 3 files changed, 174 insertions(+) diff --git a/packages/stream_chat/lib/src/client/client.dart b/packages/stream_chat/lib/src/client/client.dart index 4a03630c8e..9865ebcbd5 100644 --- a/packages/stream_chat/lib/src/client/client.dart +++ b/packages/stream_chat/lib/src/client/client.dart @@ -921,6 +921,68 @@ class StreamChatClient { extraData: extraData, ); + /// Upload an image to the Stream CDN + /// + /// Upload progress can be tracked using [onProgress], and the operation can + /// be cancelled using [cancelToken]. + /// + /// Returns a [UploadImageResponse] once uploaded successfully. + Future uploadImage( + AttachmentFile image, { + ProgressCallback? onUploadProgress, + CancelToken? cancelToken, + }) => + _chatApi.fileUploader.uploadImage( + image, + onSendProgress: onUploadProgress, + cancelToken: cancelToken, + ); + + /// Upload a file to the Stream CDN + /// + /// Upload progress can be tracked using [onProgress], and the operation can + /// be cancelled using [cancelToken]. + /// + /// Returns a [UploadFileResponse] once uploaded successfully. + Future uploadFile( + AttachmentFile file, { + ProgressCallback? onUploadProgress, + CancelToken? cancelToken, + }) => + _chatApi.fileUploader.uploadFile( + file, + onSendProgress: onUploadProgress, + cancelToken: cancelToken, + ); + + /// Remove an image from the Stream CDN using its [url]. + /// + /// The operation can be cancelled using [cancelToken] if needed. + /// + /// Returns an [EmptyResponse] once removed successfully. + Future removeImage( + String url, { + CancelToken? cancelToken, + }) => + _chatApi.fileUploader.removeImage( + url, + cancelToken: cancelToken, + ); + + /// Remove a file from the Stream CDN using its [url]. + /// + /// The operation can be cancelled using [cancelToken] if needed. + /// + /// Returns an [EmptyResponse] once removed successfully. + Future removeFile( + String url, { + CancelToken? cancelToken, + }) => + _chatApi.fileUploader.removeFile( + url, + cancelToken: cancelToken, + ); + /// Replaces the [channelId] of type [ChannelType] data with [data]. /// /// Use [updateChannelPartial] for a partial update. diff --git a/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart b/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart index c851d11472..be71bc1cfa 100644 --- a/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart +++ b/packages/stream_chat/lib/src/core/api/attachment_file_uploader.dart @@ -61,6 +61,54 @@ abstract class AttachmentFileUploader { CancelToken? cancelToken, Map? extraData, }); + + // region Standalone upload methods + + /// Uploads an image file to the CDN. + /// + /// Upload progress can be tracked using [onProgress], and the operation can + /// be cancelled using [cancelToken]. + /// + /// Returns a [UploadImageResponse] once uploaded successfully. + Future uploadImage( + AttachmentFile image, { + ProgressCallback? onSendProgress, + CancelToken? cancelToken, + }); + + /// Uploads a file to the CDN. + /// + /// Upload progress can be tracked using [onProgress], and the operation can + /// be cancelled using [cancelToken]. + /// + /// Returns a [UploadFileResponse] once uploaded successfully. + Future uploadFile( + AttachmentFile file, { + ProgressCallback? onSendProgress, + CancelToken? cancelToken, + }); + + /// Removes an image from the CDN using its [url]. + /// + /// The operation can be cancelled using [cancelToken] if needed. + /// + /// Returns a [EmptyResponse] once removed successfully. + Future removeImage( + String url, { + CancelToken? cancelToken, + }); + + /// Removes a file from the CDN using its [url]. + /// + /// The operation can be cancelled using [cancelToken] if needed. + /// + /// Returns a [EmptyResponse] once removed successfully. + Future removeFile( + String url, { + CancelToken? cancelToken, + }); + + // endregion } /// Stream's default implementation of [AttachmentFileUploader] @@ -139,4 +187,62 @@ class StreamAttachmentFileUploader implements AttachmentFileUploader { ); return EmptyResponse.fromJson(response.data); } + + @override + Future uploadImage( + AttachmentFile image, { + ProgressCallback? onSendProgress, + CancelToken? cancelToken, + }) async { + final multiPartFile = await image.toMultipartFile(); + final response = await _client.postFile( + '/uploads/image', + multiPartFile, + onSendProgress: onSendProgress, + cancelToken: cancelToken, + ); + return UploadImageResponse.fromJson(response.data); + } + + @override + Future uploadFile( + AttachmentFile file, { + ProgressCallback? onSendProgress, + CancelToken? cancelToken, + }) async { + final multiPartFile = await file.toMultipartFile(); + final response = await _client.postFile( + '/uploads/file', + multiPartFile, + onSendProgress: onSendProgress, + cancelToken: cancelToken, + ); + return UploadFileResponse.fromJson(response.data); + } + + @override + Future removeImage( + String url, { + CancelToken? cancelToken, + }) async { + final response = await _client.delete( + '/uploads/image', + queryParameters: {'url': url}, + cancelToken: cancelToken, + ); + return EmptyResponse.fromJson(response.data); + } + + @override + Future removeFile( + String url, { + CancelToken? cancelToken, + }) async { + final response = await _client.delete( + '/uploads/file', + queryParameters: {'url': url}, + cancelToken: cancelToken, + ); + return EmptyResponse.fromJson(response.data); + } } diff --git a/packages/stream_chat/lib/src/core/api/responses.dart b/packages/stream_chat/lib/src/core/api/responses.dart index c1f6703634..c8e36c558c 100644 --- a/packages/stream_chat/lib/src/core/api/responses.dart +++ b/packages/stream_chat/lib/src/core/api/responses.dart @@ -201,6 +201,12 @@ class SendFileResponse extends SendAttachmentResponse { /// Model response for [Channel.sendImage] api call typedef SendImageResponse = SendAttachmentResponse; +/// Model response for [StreamChatClient.uploadImage] api call +typedef UploadImageResponse = SendAttachmentResponse; + +/// Model response for [StreamChatClient.uploadFile] api call +typedef UploadFileResponse = SendAttachmentResponse; + /// Model response for [Channel.sendReaction] api call @JsonSerializable(createToJson: false) class SendReactionResponse extends MessageResponse { From 1b689c418d737015ec57fe9f5d2409eb86ca9b65 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:44:02 +0200 Subject: [PATCH 02/10] chore: update CHANGELOG.md and migration --- migrations/v10-migration.md | 114 +++++++++++++++++++++++++++ packages/stream_chat/CHANGELOG.md | 127 ++++++++++++++++++++---------- 2 files changed, 201 insertions(+), 40 deletions(-) diff --git a/migrations/v10-migration.md b/migrations/v10-migration.md index 951fd6c344..c09df6ffbc 100644 --- a/migrations/v10-migration.md +++ b/migrations/v10-migration.md @@ -8,6 +8,10 @@ This guide includes breaking changes grouped by release phase: +### ๐Ÿšง v10.0.0-beta.7 + +- [AttachmentFileUploader](#-attachmentfileuploader) + ### ๐Ÿšง v10.0.0-beta.4 - [SendReaction](#-sendreaction) @@ -28,6 +32,113 @@ This guide includes breaking changes grouped by release phase: --- +## ๐Ÿงช Migration for v10.0.0-beta.7 + +### ๐Ÿ›  AttachmentFileUploader + +#### Key Changes: + +- `AttachmentFileUploader` interface now includes four new abstract methods: `uploadImage`, `uploadFile`, `removeImage`, and `removeFile`. +- Custom implementations must implement these new standalone upload/removal methods. + +#### Migration Steps: + +**Before:** +```dart +class CustomAttachmentFileUploader implements AttachmentFileUploader { + // Only needed to implement sendImage, sendFile, deleteImage, deleteFile + + @override + Future sendImage(/* ... */) async { + // Implementation + } + + @override + Future sendFile(/* ... */) async { + // Implementation + } + + @override + Future deleteImage(/* ... */) async { + // Implementation + } + + @override + Future deleteFile(/* ... */) async { + // Implementation + } +} +``` + +**After:** +```dart +class CustomAttachmentFileUploader implements AttachmentFileUploader { + // Must now implement all 8 methods including the new standalone ones + + @override + Future sendImage(/* ... */) async { + // Implementation + } + + @override + Future sendFile(/* ... */) async { + // Implementation + } + + @override + Future deleteImage(/* ... */) async { + // Implementation + } + + @override + Future deleteFile(/* ... */) async { + // Implementation + } + + // New required methods + @override + Future uploadImage( + AttachmentFile image, { + ProgressCallback? onSendProgress, + CancelToken? cancelToken, + }) async { + // Implementation for standalone image upload + } + + @override + Future uploadFile( + AttachmentFile file, { + ProgressCallback? onSendProgress, + CancelToken? cancelToken, + }) async { + // Implementation for standalone file upload + } + + @override + Future removeImage( + String url, { + CancelToken? cancelToken, + }) async { + // Implementation for standalone image removal + } + + @override + Future removeFile( + String url, { + CancelToken? cancelToken, + }) async { + // Implementation for standalone file removal + } +} +``` + +> โš ๏ธ **Important:** +> - Custom `AttachmentFileUploader` implementations must now implement four additional methods +> - The new methods support standalone uploads/removals without requiring channel context +> - `UploadImageResponse` and `UploadFileResponse` are aliases for `SendAttachmentResponse` + +--- + ## ๐Ÿงช Migration for v10.0.0-beta.4 ### ๐Ÿ›  SendReaction @@ -429,6 +540,9 @@ StreamMessageWidget( ## ๐ŸŽ‰ You're Ready to Migrate! +### For v10.0.0-beta.7: +- โœ… Update custom `AttachmentFileUploader` implementations to include the four new abstract methods: `uploadImage`, `uploadFile`, `removeImage`, and `removeFile` + ### For v10.0.0-beta.3: - โœ… Update attachment picker options to use `SystemAttachmentPickerOption` or `TabbedAttachmentPickerOption` - โœ… Handle new `StreamAttachmentPickerResult` return type from attachment picker diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index c1402692f8..dcaf2d577d 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,19 @@ +## 10.0.0-beta.7 + +๐Ÿ›‘๏ธ Breaking + +- **Added new abstract methods to `AttachmentFileUploader`**: The `AttachmentFileUploader` interface + now includes four new abstract methods (`uploadImage`, `uploadFile`, `removeImage`, `removeFile`). + Custom implementations must implement these methods. + +โœ… Added + +- Added standalone file and image upload/removal methods for CDN operations: + - `StreamChatClient.uploadImage()` - Upload an image to the Stream CDN + - `StreamChatClient.uploadFile()` - Upload a file to the Stream CDN + - `StreamChatClient.removeImage()` - Remove an image from the Stream CDN + - `StreamChatClient.removeFile()` - Remove a file from the Stream CDN + ## 10.0.0-beta.6 - Included the changes from version [`9.17.0`](https://pub.dev/packages/stream_chat/changelog). @@ -42,11 +58,11 @@ โœ… Added - Added comprehensive location sharing support with static and live location features: - - `Channel.sendStaticLocation()` - Send a static location message to the channel - - `Channel.startLiveLocationSharing()` - Start sharing live location with automatic updates - - `Channel.activeLiveLocations` - Track members active live location shares in the channel - - `Client.activeLiveLocations` - Access current user active live location shares across channels - - Location event listeners for `locationShared`, `locationUpdated`, and `locationExpired` events + - `Channel.sendStaticLocation()` - Send a static location message to the channel + - `Channel.startLiveLocationSharing()` - Start sharing live location with automatic updates + - `Channel.activeLiveLocations` - Track members active live location shares in the channel + - `Client.activeLiveLocations` - Access current user active live location shares across channels + - Location event listeners for `locationShared`, `locationUpdated`, and `locationExpired` events - Included the changes from version [`9.15.0`](https://pub.dev/packages/stream_chat/changelog). @@ -68,11 +84,16 @@ ๐Ÿ›‘๏ธ Breaking -- **Deprecated API Cleanup**: Removed all deprecated classes, methods, and properties for the v10 major release: - - **Removed Classes**: `PermissionType` (use string constants like `'delete-channel'`, `'update-channel'`), `CallApi`, `CallPayload`, `CallTokenPayload`, `CreateCallPayload` - - **Removed Methods**: `cooldownStartedAt` getter from `Channel`, `getCallToken` and `createCall` from `StreamChatClient` - - **Removed Properties**: `reactionCounts` and `reactionScores` getters from `Message` (use `reactionGroups` instead), `call` property from `StreamChatApi` - - **Removed Files**: `permission_type.dart`, `call_api.dart`, `call_payload.dart` and their associated tests +- **Deprecated API Cleanup**: Removed all deprecated classes, methods, and properties for the v10 + major release: + - **Removed Classes**: `PermissionType` (use string constants like `'delete-channel'`, + `'update-channel'`), `CallApi`, `CallPayload`, `CallTokenPayload`, `CreateCallPayload` + - **Removed Methods**: `cooldownStartedAt` getter from `Channel`, `getCallToken` and + `createCall` from `StreamChatClient` + - **Removed Properties**: `reactionCounts` and `reactionScores` getters from `Message` (use + `reactionGroups` instead), `call` property from `StreamChatApi` + - **Removed Files**: `permission_type.dart`, `call_api.dart`, `call_payload.dart` and their + associated tests - Included the changes from version [`9.14.0`](https://pub.dev/packages/stream_chat/changelog). @@ -127,6 +148,7 @@ `message.reactionGroups`. ๐Ÿž Fixed + - `Null check operator used on a null value` in Websocket connect. - Ensure query cache is cleared when refreshing channel queries. @@ -134,7 +156,8 @@ ๐Ÿž Fixed -- [[#2013]](https://github.com/GetStream/stream-chat-flutter/issues/2013) Fix pinned message get duplicated. +- [[#2013]](https://github.com/GetStream/stream-chat-flutter/issues/2013) Fix pinned message get + duplicated. ๐Ÿ”„ Changed @@ -182,9 +205,10 @@ - Added support for message moderation feature. - Improved user blocking functionality by updating client state when blocking/unblocking users: - - `client.blockUser` now updates `currentUser.blockedUserIds` list with newly blocked user IDs. - - `client.unblockUser` now removes the unblocked user ID from `currentUser.blockedUserIds` list. - - `client.queryBlockedUsers` now updates `currentUser.blockedUserIds` with the latest blocked users data. + - `client.blockUser` now updates `currentUser.blockedUserIds` list with newly blocked user IDs. + - `client.unblockUser` now removes the unblocked user ID from `currentUser.blockedUserIds` list. + - `client.queryBlockedUsers` now updates `currentUser.blockedUserIds` with the latest blocked + users data. ๐Ÿž Fixed @@ -202,24 +226,30 @@ ๐Ÿž Fixed -- [[#1775]](https://github.com/GetStream/stream-chat-flutter/issues/1775) Fix incorrect message order. +- [[#1775]](https://github.com/GetStream/stream-chat-flutter/issues/1775) Fix incorrect message + order. ## 9.5.0 โœ… Added -- [[#2101]](https://github.com/GetStream/stream-chat-flutter/issues/2101) Added support for system messages not updating `channel.lastMessageAt`. +- [[#2101]](https://github.com/GetStream/stream-chat-flutter/issues/2101) Added support for system + messages not updating `channel.lastMessageAt`. - Added support for sending private or restricted visibility messages. - Add `member.extraData` field. ๐Ÿž Fixed -- [[#1774]](https://github.com/GetStream/stream-chat-flutter/issues/1774) Fixed failed to execute 'close' on 'WebSocket'. -- [[#2016]](https://github.com/GetStream/stream-chat-flutter/issues/2016) Fix muted channel's unreadCount incorrectly updated. - +- [[#1774]](https://github.com/GetStream/stream-chat-flutter/issues/1774) Fixed failed to execute ' + close' on 'WebSocket'. +- [[#2016]](https://github.com/GetStream/stream-chat-flutter/issues/2016) Fix muted channel's + unreadCount incorrectly updated. + ๐Ÿ”„ Changed -- Refactored identifying the `Attachment.uploadState` logic for local and remote attachments. Also updated the logic for determining the attachment type to check for ogScrapeUrl instead of `AttachmentType.giphy`. +- Refactored identifying the `Attachment.uploadState` logic for local and remote attachments. Also + updated the logic for determining the attachment type to check for ogScrapeUrl instead of + `AttachmentType.giphy`. - Improved the `x-stream-client` header generation for better client identification and analytics. ## 9.4.0 @@ -327,7 +357,7 @@ ๐Ÿž Fixed -- [[#1837]](https://github.com/GetStream/stream-chat-flutter/issues/1837) Delete image and file +- [[#1837]](https://github.com/GetStream/stream-chat-flutter/issues/1837) Delete image and file attachments from the CDN, when the message get's hard deleted. - [[#1819]](https://github.com/GetStream/stream-chat-flutter/issues/1819) Handle network errors with String payload. @@ -336,8 +366,10 @@ ๐Ÿž Fixed -- [[#1811]](https://github.com/GetStream/stream-chat-flutter/issues/1811) Bumped `UUID` dependency to `^4.2.1`. This - **might** produce a **breaking change** if you your code depends in `UUID` `3.x.x` directly or indirectly. +- [[#1811]](https://github.com/GetStream/stream-chat-flutter/issues/1811) Bumped `UUID` dependency + to `^4.2.1`. This + **might** produce a **breaking change** if you your code depends in `UUID` `3.x.x` directly or + indirectly. ## 7.0.0 @@ -345,19 +377,20 @@ - Removed deprecated `channelQuery.sort` property. Use `channelStateSort` instead. - Removed deprecated `RetryPolicy.retryTimeout` property. Use `delayFactor` instead. -- Removed deprecated `StreamChatNetworkError.fromDioError` constructor. Use `StreamChatNetworkError.fromDioException` +- Removed deprecated `StreamChatNetworkError.fromDioError` constructor. Use + `StreamChatNetworkError.fromDioException` instead. - Removed deprecated `MessageSendingStatus` enum. Use `MessageState` instead. ๐Ÿ”„ Changed - Updated minimum supported `SDK` version to Flutter 3.13/Dart 3.1 - + # 6.10.0 ๐Ÿž Fixed -- [[#1753]](https://github.com/GetStream/stream-chat-flutter/issues/1753) Fixed Unhandled null +- [[#1753]](https://github.com/GetStream/stream-chat-flutter/issues/1753) Fixed Unhandled null check operator exception when user is removed from a channel. ## 6.9.0 @@ -377,7 +410,8 @@ โœ… Added -- Added support for `channel.countUnreadMentions()` to get the count of unread messages mentioning the current user on a +- Added support for `channel.countUnreadMentions()` to get the count of unread messages mentioning + the current user on a channel. [#1692](https://github.com/GetStream/stream-chat-flutter/issues/1692) ๐Ÿ”„ Changed @@ -388,7 +422,8 @@ โœ… Added -- Added support for setting `Message.type`. [#1682](https://github.com/GetStream/stream-chat-flutter/issues/1682) +- Added support for setting + `Message.type`. [#1682](https://github.com/GetStream/stream-chat-flutter/issues/1682) ``` It is now possible to send system messages. System messages differ from normal messages in the way they are presented to the user. Like the name says, system messages are normally send from the system itself, but a user is @@ -413,16 +448,19 @@ ๐Ÿž Fixed -- [[#1293]](https://github.com/GetStream/stream-chat-flutter/issues/1293) Fixed wrong message order when sending +- [[#1293]](https://github.com/GetStream/stream-chat-flutter/issues/1293) Fixed wrong message order + when sending messages quickly. -- [[#1612]](https://github.com/GetStream/stream-chat-flutter/issues/1612) Fixed `Channel.isMutedStream` does not emit +- [[#1612]](https://github.com/GetStream/stream-chat-flutter/issues/1612) Fixed + `Channel.isMutedStream` does not emit when channel mute expires. ## 6.3.0 ๐Ÿž Fixed -- [[#1585]](https://github.com/GetStream/stream-chat-flutter/issues/1585) Fixed channels left not being removed from +- [[#1585]](https://github.com/GetStream/stream-chat-flutter/issues/1585) Fixed channels left not + being removed from the persistent storage. ๐Ÿ”„ Changed @@ -433,23 +471,28 @@ ๐Ÿž Fixed -- [[#1422]](https://github.com/GetStream/stream-chat-flutter/issues/1422) Fixed `User.createdAt` property using +- [[#1422]](https://github.com/GetStream/stream-chat-flutter/issues/1422) Fixed `User.createdAt` + property using currentTime when the ws connection is not established. โœ… Added -- Added support for `ChatPersistenceClient.isConnected` for checking if the client is connected to the database. +- Added support for `ChatPersistenceClient.isConnected` for checking if the client is connected to + the database. - Added support for `ChatPersistenceClient.userId` for getting the current connected user id. -- Added two new methods `ChatPersistenceClient.disconnect` and `ChatPersistenceClient.connect` for disconnecting and +- Added two new methods `ChatPersistenceClient.disconnect` and `ChatPersistenceClient.connect` for + disconnecting and connecting to the database. ## 6.1.0 ๐Ÿž Fixed -- [[#1355]](https://github.com/GetStream/stream-chat-flutter/issues/1355) Fixed error while hiding channel and clearing +- [[#1355]](https://github.com/GetStream/stream-chat-flutter/issues/1355) Fixed error while hiding + channel and clearing message history. -- [[#1525]](https://github.com/GetStream/stream-chat-flutter/issues/1525) Fixed removing message not removing quoted +- [[#1525]](https://github.com/GetStream/stream-chat-flutter/issues/1525) Fixed removing message not + removing quoted message reference. โœ… Added @@ -457,7 +500,8 @@ - Expose `ChannelMute` class. [#1473](https://github.com/GetStream/stream-chat-flutter/issues/1473) - Added synchronization to the `StreamChatClient.sync` api. [#1392](https://github.com/GetStream/stream-chat-flutter/issues/1392) -- Added support for `StreamChatClient.chatApiInterceptors` to add custom interceptors to the API client. +- Added support for `StreamChatClient.chatApiInterceptors` to add custom interceptors to the API + client. [#1265](https://github.com/GetStream/stream-chat-flutter/issues/1265). ```dart @@ -489,7 +533,8 @@ ๐Ÿž Fixed -- Fixed streamWatchers. Before it was always new, now it is possible to follow the watchers of a channel. +- Fixed streamWatchers. Before it was always new, now it is possible to follow the watchers of a + channel. - Make `Message.i18n` field read-only. ๐Ÿ”„ Changed @@ -919,7 +964,8 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra - `StreamChatError` -> parent type for all the stream errors. - `StreamWebSocketError` -> for user web socket related errors. - `StreamChatNetworkError` -> for network related errors. -- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual parameters +- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual + parameters - `option.state` -> bool state - `option.watch` -> bool watch - `option.presence` -> bool presence @@ -967,7 +1013,8 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra - `StreamChatError` -> parent type for all the stream errors. - `StreamWebSocketError` -> for user web socket related errors. - `StreamChatNetworkError` -> for network related errors. -- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual parameters +- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual + parameters - `option.state` -> bool state - `option.watch` -> bool watch - `option.presence` -> bool presence From 3015b1d63c594c407188cf00a8bb150fcd80b862 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:47:10 +0200 Subject: [PATCH 03/10] test: add tests --- .../test/src/client/client_test.dart | 56 ++++++++++++ .../api/attachment_file_uploader_test.dart | 90 +++++++++++++++++++ 2 files changed, 146 insertions(+) diff --git a/packages/stream_chat/test/src/client/client_test.dart b/packages/stream_chat/test/src/client/client_test.dart index 3a9f3bb66d..505ba6d0a2 100644 --- a/packages/stream_chat/test/src/client/client_test.dart +++ b/packages/stream_chat/test/src/client/client_test.dart @@ -1111,6 +1111,62 @@ void main() { verifyNoMoreInteractions(api.fileUploader); }); + test('`.uploadImage`', () async { + final image = AttachmentFile(size: 33, path: 'test-image-path'); + const fileUrl = 'test-image-url'; + + when(() => api.fileUploader.uploadImage(image)) + .thenAnswer((_) async => UploadImageResponse()..file = fileUrl); + + final res = await client.uploadImage(image); + expect(res, isNotNull); + expect(res.file, fileUrl); + + verify(() => api.fileUploader.uploadImage(image)).called(1); + verifyNoMoreInteractions(api.fileUploader); + }); + + test('`.uploadFile`', () async { + final file = AttachmentFile(size: 33, path: 'test-file-path'); + const fileUrl = 'test-file-url'; + + when(() => api.fileUploader.uploadFile(file)) + .thenAnswer((_) async => UploadFileResponse()..file = fileUrl); + + final res = await client.uploadFile(file); + expect(res, isNotNull); + expect(res.file, fileUrl); + + verify(() => api.fileUploader.uploadFile(file)).called(1); + verifyNoMoreInteractions(api.fileUploader); + }); + + test('`.removeImage`', () async { + const imageUrl = 'test-image-url'; + + when(() => api.fileUploader.removeImage(imageUrl)) + .thenAnswer((_) async => EmptyResponse()); + + final res = await client.removeImage(imageUrl); + expect(res, isNotNull); + + verify(() => api.fileUploader.removeImage(imageUrl)).called(1); + verifyNoMoreInteractions(api.fileUploader); + }); + + test('`.removeFile`', () async { + const fileUrl = 'test-file-url'; + + when(() => api.fileUploader.removeFile(fileUrl)) + .thenAnswer((_) async => EmptyResponse()); + + final res = await client.removeFile(fileUrl); + expect(res, isNotNull); + + verify(() => api.fileUploader.removeFile(fileUrl)).called(1); + verifyNoMoreInteractions(api.fileUploader); + }); + test('`.updateChannel`', () async { const channelId = 'test-channel-id'; const channelType = 'test-channel-type'; diff --git a/packages/stream_chat/test/src/core/api/attachment_file_uploader_test.dart b/packages/stream_chat/test/src/core/api/attachment_file_uploader_test.dart index 58ffdefb69..5250dbbc9a 100644 --- a/packages/stream_chat/test/src/core/api/attachment_file_uploader_test.dart +++ b/packages/stream_chat/test/src/core/api/attachment_file_uploader_test.dart @@ -133,4 +133,94 @@ void main() { verify(() => client.delete(path, queryParameters: {'url': url})).called(1); verifyNoMoreInteractions(client); }); + + test('uploadImage', () async { + const path = '/uploads/image'; + final file = assetFile('test_image.jpeg'); + final attachmentFile = AttachmentFile( + size: 333, + path: file.path, + bytes: file.readAsBytesSync(), + ); + final multipartFile = await attachmentFile.toMultipartFile(); + + when(() => client.postFile( + path, + any(that: isSameMultipartFileAs(multipartFile)), + )).thenAnswer((_) async => successResponse(path, data: { + 'file': 'test-image-url', + })); + + final res = await fileUploader.uploadImage(attachmentFile); + + expect(res, isNotNull); + expect(res.file, isNotNull); + expect(res.file, isNotEmpty); + + verify(() => client.postFile( + path, + any(that: isSameMultipartFileAs(multipartFile)), + )).called(1); + verifyNoMoreInteractions(client); + }); + + test('uploadFile', () async { + const path = '/uploads/file'; + final file = assetFile('example.pdf'); + final attachmentFile = AttachmentFile( + size: 333, + path: file.path, + bytes: file.readAsBytesSync(), + ); + final multipartFile = await attachmentFile.toMultipartFile(); + + when(() => client.postFile( + path, + any(that: isSameMultipartFileAs(multipartFile)), + )).thenAnswer((_) async => successResponse(path, data: { + 'file': 'test-file-url', + })); + + final res = await fileUploader.uploadFile(attachmentFile); + + expect(res, isNotNull); + expect(res.file, isNotNull); + expect(res.file, isNotEmpty); + + verify(() => client.postFile( + path, + any(that: isSameMultipartFileAs(multipartFile)), + )).called(1); + verifyNoMoreInteractions(client); + }); + + test('removeImage', () async { + const path = '/uploads/image'; + const url = 'test-image-url'; + + when(() => client.delete(path, queryParameters: {'url': url})).thenAnswer( + (_) async => successResponse(path, data: {})); + + final res = await fileUploader.removeImage(url); + + expect(res, isNotNull); + + verify(() => client.delete(path, queryParameters: {'url': url})).called(1); + verifyNoMoreInteractions(client); + }); + + test('removeFile', () async { + const path = '/uploads/file'; + const url = 'test-file-url'; + + when(() => client.delete(path, queryParameters: {'url': url})).thenAnswer( + (_) async => successResponse(path, data: {})); + + final res = await fileUploader.removeFile(url); + + expect(res, isNotNull); + + verify(() => client.delete(path, queryParameters: {'url': url})).called(1); + verifyNoMoreInteractions(client); + }); } From e079dcb8ac6af5bb2078db08906551162c11a389 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:50:40 +0200 Subject: [PATCH 04/10] chore: update CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index dcaf2d577d..d25ec9fe7c 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,4 +1,4 @@ -## 10.0.0-beta.7 +## Upcoming Beta ๐Ÿ›‘๏ธ Breaking From d317476a191551afe5c878ea89046dad4b9d8c2e Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:53:18 +0200 Subject: [PATCH 05/10] chore: update CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 159 ++++++++++++------------------ 1 file changed, 64 insertions(+), 95 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index d25ec9fe7c..bd70b47d8a 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -58,11 +58,11 @@ โœ… Added - Added comprehensive location sharing support with static and live location features: - - `Channel.sendStaticLocation()` - Send a static location message to the channel - - `Channel.startLiveLocationSharing()` - Start sharing live location with automatic updates - - `Channel.activeLiveLocations` - Track members active live location shares in the channel - - `Client.activeLiveLocations` - Access current user active live location shares across channels - - Location event listeners for `locationShared`, `locationUpdated`, and `locationExpired` events + - `Channel.sendStaticLocation()` - Send a static location message to the channel + - `Channel.startLiveLocationSharing()` - Start sharing live location with automatic updates + - `Channel.activeLiveLocations` - Track members active live location shares in the channel + - `Client.activeLiveLocations` - Access current user active live location shares across channels + - Location event listeners for `locationShared`, `locationUpdated`, and `locationExpired` events - Included the changes from version [`9.15.0`](https://pub.dev/packages/stream_chat/changelog). @@ -84,16 +84,11 @@ ๐Ÿ›‘๏ธ Breaking -- **Deprecated API Cleanup**: Removed all deprecated classes, methods, and properties for the v10 - major release: - - **Removed Classes**: `PermissionType` (use string constants like `'delete-channel'`, - `'update-channel'`), `CallApi`, `CallPayload`, `CallTokenPayload`, `CreateCallPayload` - - **Removed Methods**: `cooldownStartedAt` getter from `Channel`, `getCallToken` and - `createCall` from `StreamChatClient` - - **Removed Properties**: `reactionCounts` and `reactionScores` getters from `Message` (use - `reactionGroups` instead), `call` property from `StreamChatApi` - - **Removed Files**: `permission_type.dart`, `call_api.dart`, `call_payload.dart` and their - associated tests +- **Deprecated API Cleanup**: Removed all deprecated classes, methods, and properties for the v10 major release: + - **Removed Classes**: `PermissionType` (use string constants like `'delete-channel'`, `'update-channel'`), `CallApi`, `CallPayload`, `CallTokenPayload`, `CreateCallPayload` + - **Removed Methods**: `cooldownStartedAt` getter from `Channel`, `getCallToken` and `createCall` from `StreamChatClient` + - **Removed Properties**: `reactionCounts` and `reactionScores` getters from `Message` (use `reactionGroups` instead), `call` property from `StreamChatApi` + - **Removed Files**: `permission_type.dart`, `call_api.dart`, `call_payload.dart` and their associated tests - Included the changes from version [`9.14.0`](https://pub.dev/packages/stream_chat/changelog). @@ -148,7 +143,6 @@ `message.reactionGroups`. ๐Ÿž Fixed - - `Null check operator used on a null value` in Websocket connect. - Ensure query cache is cleared when refreshing channel queries. @@ -156,8 +150,7 @@ ๐Ÿž Fixed -- [[#2013]](https://github.com/GetStream/stream-chat-flutter/issues/2013) Fix pinned message get - duplicated. +- [[#2013]](https://github.com/GetStream/stream-chat-flutter/issues/2013) Fix pinned message get duplicated. ๐Ÿ”„ Changed @@ -177,10 +170,10 @@ - Added support for Channel pinning and archiving. - Added support for 'DraftMessage' feature, which allows users to save draft messages in channels. Several methods have been added to the `Client` and `Channel` class to manage draft messages: - - `channel.createDraft`: Saves a draft message for a specific channel. - - `channel.getDraft`: Retrieves a draft message for a specific channel. - - `channel.deleteDraft`: Deletes a draft message for a specific channel. - - `client.queryDrafts`: Queries draft messages created by the current user. + - `channel.createDraft`: Saves a draft message for a specific channel. + - `channel.getDraft`: Retrieves a draft message for a specific channel. + - `channel.deleteDraft`: Deletes a draft message for a specific channel. + - `client.queryDrafts`: Queries draft messages created by the current user. ๐Ÿž Fixed @@ -205,10 +198,9 @@ - Added support for message moderation feature. - Improved user blocking functionality by updating client state when blocking/unblocking users: - - `client.blockUser` now updates `currentUser.blockedUserIds` list with newly blocked user IDs. - - `client.unblockUser` now removes the unblocked user ID from `currentUser.blockedUserIds` list. - - `client.queryBlockedUsers` now updates `currentUser.blockedUserIds` with the latest blocked - users data. + - `client.blockUser` now updates `currentUser.blockedUserIds` list with newly blocked user IDs. + - `client.unblockUser` now removes the unblocked user ID from `currentUser.blockedUserIds` list. + - `client.queryBlockedUsers` now updates `currentUser.blockedUserIds` with the latest blocked users data. ๐Ÿž Fixed @@ -226,30 +218,24 @@ ๐Ÿž Fixed -- [[#1775]](https://github.com/GetStream/stream-chat-flutter/issues/1775) Fix incorrect message - order. +- [[#1775]](https://github.com/GetStream/stream-chat-flutter/issues/1775) Fix incorrect message order. ## 9.5.0 โœ… Added -- [[#2101]](https://github.com/GetStream/stream-chat-flutter/issues/2101) Added support for system - messages not updating `channel.lastMessageAt`. +- [[#2101]](https://github.com/GetStream/stream-chat-flutter/issues/2101) Added support for system messages not updating `channel.lastMessageAt`. - Added support for sending private or restricted visibility messages. - Add `member.extraData` field. ๐Ÿž Fixed -- [[#1774]](https://github.com/GetStream/stream-chat-flutter/issues/1774) Fixed failed to execute ' - close' on 'WebSocket'. -- [[#2016]](https://github.com/GetStream/stream-chat-flutter/issues/2016) Fix muted channel's - unreadCount incorrectly updated. +- [[#1774]](https://github.com/GetStream/stream-chat-flutter/issues/1774) Fixed failed to execute 'close' on 'WebSocket'. +- [[#2016]](https://github.com/GetStream/stream-chat-flutter/issues/2016) Fix muted channel's unreadCount incorrectly updated. ๐Ÿ”„ Changed -- Refactored identifying the `Attachment.uploadState` logic for local and remote attachments. Also - updated the logic for determining the attachment type to check for ogScrapeUrl instead of - `AttachmentType.giphy`. +- Refactored identifying the `Attachment.uploadState` logic for local and remote attachments. Also updated the logic for determining the attachment type to check for ogScrapeUrl instead of `AttachmentType.giphy`. - Improved the `x-stream-client` header generation for better client identification and analytics. ## 9.4.0 @@ -366,10 +352,8 @@ ๐Ÿž Fixed -- [[#1811]](https://github.com/GetStream/stream-chat-flutter/issues/1811) Bumped `UUID` dependency - to `^4.2.1`. This - **might** produce a **breaking change** if you your code depends in `UUID` `3.x.x` directly or - indirectly. +- [[#1811]](https://github.com/GetStream/stream-chat-flutter/issues/1811) Bumped `UUID` dependency to `^4.2.1`. This + **might** produce a **breaking change** if you your code depends in `UUID` `3.x.x` directly or indirectly. ## 7.0.0 @@ -377,8 +361,7 @@ - Removed deprecated `channelQuery.sort` property. Use `channelStateSort` instead. - Removed deprecated `RetryPolicy.retryTimeout` property. Use `delayFactor` instead. -- Removed deprecated `StreamChatNetworkError.fromDioError` constructor. Use - `StreamChatNetworkError.fromDioException` +- Removed deprecated `StreamChatNetworkError.fromDioError` constructor. Use `StreamChatNetworkError.fromDioException` instead. - Removed deprecated `MessageSendingStatus` enum. Use `MessageState` instead. @@ -410,8 +393,7 @@ โœ… Added -- Added support for `channel.countUnreadMentions()` to get the count of unread messages mentioning - the current user on a +- Added support for `channel.countUnreadMentions()` to get the count of unread messages mentioning the current user on a channel. [#1692](https://github.com/GetStream/stream-chat-flutter/issues/1692) ๐Ÿ”„ Changed @@ -422,8 +404,7 @@ โœ… Added -- Added support for setting - `Message.type`. [#1682](https://github.com/GetStream/stream-chat-flutter/issues/1682) +- Added support for setting `Message.type`. [#1682](https://github.com/GetStream/stream-chat-flutter/issues/1682) ``` It is now possible to send system messages. System messages differ from normal messages in the way they are presented to the user. Like the name says, system messages are normally send from the system itself, but a user is @@ -448,19 +429,16 @@ ๐Ÿž Fixed -- [[#1293]](https://github.com/GetStream/stream-chat-flutter/issues/1293) Fixed wrong message order - when sending +- [[#1293]](https://github.com/GetStream/stream-chat-flutter/issues/1293) Fixed wrong message order when sending messages quickly. -- [[#1612]](https://github.com/GetStream/stream-chat-flutter/issues/1612) Fixed - `Channel.isMutedStream` does not emit +- [[#1612]](https://github.com/GetStream/stream-chat-flutter/issues/1612) Fixed `Channel.isMutedStream` does not emit when channel mute expires. ## 6.3.0 ๐Ÿž Fixed -- [[#1585]](https://github.com/GetStream/stream-chat-flutter/issues/1585) Fixed channels left not - being removed from +- [[#1585]](https://github.com/GetStream/stream-chat-flutter/issues/1585) Fixed channels left not being removed from the persistent storage. ๐Ÿ”„ Changed @@ -471,28 +449,23 @@ ๐Ÿž Fixed -- [[#1422]](https://github.com/GetStream/stream-chat-flutter/issues/1422) Fixed `User.createdAt` - property using +- [[#1422]](https://github.com/GetStream/stream-chat-flutter/issues/1422) Fixed `User.createdAt` property using currentTime when the ws connection is not established. โœ… Added -- Added support for `ChatPersistenceClient.isConnected` for checking if the client is connected to - the database. +- Added support for `ChatPersistenceClient.isConnected` for checking if the client is connected to the database. - Added support for `ChatPersistenceClient.userId` for getting the current connected user id. -- Added two new methods `ChatPersistenceClient.disconnect` and `ChatPersistenceClient.connect` for - disconnecting and +- Added two new methods `ChatPersistenceClient.disconnect` and `ChatPersistenceClient.connect` for disconnecting and connecting to the database. ## 6.1.0 ๐Ÿž Fixed -- [[#1355]](https://github.com/GetStream/stream-chat-flutter/issues/1355) Fixed error while hiding - channel and clearing +- [[#1355]](https://github.com/GetStream/stream-chat-flutter/issues/1355) Fixed error while hiding channel and clearing message history. -- [[#1525]](https://github.com/GetStream/stream-chat-flutter/issues/1525) Fixed removing message not - removing quoted +- [[#1525]](https://github.com/GetStream/stream-chat-flutter/issues/1525) Fixed removing message not removing quoted message reference. โœ… Added @@ -500,8 +473,7 @@ - Expose `ChannelMute` class. [#1473](https://github.com/GetStream/stream-chat-flutter/issues/1473) - Added synchronization to the `StreamChatClient.sync` api. [#1392](https://github.com/GetStream/stream-chat-flutter/issues/1392) -- Added support for `StreamChatClient.chatApiInterceptors` to add custom interceptors to the API - client. +- Added support for `StreamChatClient.chatApiInterceptors` to add custom interceptors to the API client. [#1265](https://github.com/GetStream/stream-chat-flutter/issues/1265). ```dart @@ -533,8 +505,7 @@ ๐Ÿž Fixed -- Fixed streamWatchers. Before it was always new, now it is possible to follow the watchers of a - channel. +- Fixed streamWatchers. Before it was always new, now it is possible to follow the watchers of a channel. - Make `Message.i18n` field read-only. ๐Ÿ”„ Changed @@ -868,12 +839,12 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra ๐Ÿ›‘๏ธ Breaking Changes from `2.2.1` - Added 6 new methods in `ChatPersistenceClient`. - - `bulkUpdateMessages` - - `bulkUpdatePinnedMessages` - - `bulkUpdateMembers` - - `bulkUpdateReads` - - `updatePinnedMessageReactions` - - `deletePinnedMessageReactionsByMessageId` + - `bulkUpdateMessages` + - `bulkUpdatePinnedMessages` + - `bulkUpdateMembers` + - `bulkUpdateReads` + - `updatePinnedMessageReactions` + - `deletePinnedMessageReactionsByMessageId` โœ… Added @@ -957,20 +928,19 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra - `ConnectUserWithProvider` now requires `tokenProvider` as a required parameter. (Removed from the constructor) - `client.disconnect()` is now divided into two different functions - - `client.closeConnection()` -> for closing user web socket connection. - - `client.disconnectUser()` -> for disconnecting user and resetting client state. + - `client.closeConnection()` -> for closing user web socket connection. + - `client.disconnectUser()` -> for disconnecting user and resetting client state. - `client.devToken()` now returns a `Token` model instead of `String`. - `ApiError` is removed in favor of `StreamChatError` - - `StreamChatError` -> parent type for all the stream errors. - - `StreamWebSocketError` -> for user web socket related errors. - - `StreamChatNetworkError` -> for network related errors. -- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual - parameters - - `option.state` -> bool state - - `option.watch` -> bool watch - - `option.presence` -> bool presence + - `StreamChatError` -> parent type for all the stream errors. + - `StreamWebSocketError` -> for user web socket related errors. + - `StreamChatNetworkError` -> for network related errors. +- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual parameters + - `option.state` -> bool state + - `option.watch` -> bool watch + - `option.presence` -> bool presence - `client.queryUsers()` options parameter is removed in favor of individual parameters - - `option.presence` -> bool presence + - `option.presence` -> bool presence - Migrate this package to null safety - Added typed filters @@ -1006,20 +976,19 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra - `ConnectUserWithProvider` now requires `tokenProvider` as a required parameter. (Removed from the constructor) - `client.disconnect()` is now divided into two different functions - - `client.closeConnection()` -> for closing user web socket connection. - - `client.disconnectUser()` -> for disconnecting user and resetting client state. + - `client.closeConnection()` -> for closing user web socket connection. + - `client.disconnectUser()` -> for disconnecting user and resetting client state. - `client.devToken()` now returns a `Token` model instead of `String`. - `ApiError` is removed in favor of `StreamChatError` - - `StreamChatError` -> parent type for all the stream errors. - - `StreamWebSocketError` -> for user web socket related errors. - - `StreamChatNetworkError` -> for network related errors. -- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual - parameters - - `option.state` -> bool state - - `option.watch` -> bool watch - - `option.presence` -> bool presence + - `StreamChatError` -> parent type for all the stream errors. + - `StreamWebSocketError` -> for user web socket related errors. + - `StreamChatNetworkError` -> for network related errors. +- `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual parameters + - `option.state` -> bool state + - `option.watch` -> bool watch + - `option.presence` -> bool presence - `client.queryUsers()` options parameter is removed in favor of individual parameters - - `option.presence` -> bool presence + - `option.presence` -> bool presence โœ… Added From ae6ac5902e966bcae055dd40fec04c709e808995 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:53:57 +0200 Subject: [PATCH 06/10] chore: update CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index bd70b47d8a..ecd130d543 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -6,6 +6,8 @@ now includes four new abstract methods (`uploadImage`, `uploadFile`, `removeImage`, `removeFile`). Custom implementations must implement these methods. +For more details, please refer to the [migration guide](../../migrations/v10-migration.md). + โœ… Added - Added standalone file and image upload/removal methods for CDN operations: From 6a596a3290056f743db752cabb4d7c0d5f9fd912 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:56:27 +0200 Subject: [PATCH 07/10] chore: update CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index ecd130d543..0405ec0729 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1556,4 +1556,4 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra ## 0.0.2 -- first beta version +- first beta version \ No newline at end of file From 9717e6db7cd4f7d083e149d6427ea9e73bb29f0b Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 21:59:39 +0200 Subject: [PATCH 08/10] Discard changes to packages/stream_chat/CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 84 ++++++++++++------------------- 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 0405ec0729..c1402692f8 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,21 +1,3 @@ -## Upcoming Beta - -๐Ÿ›‘๏ธ Breaking - -- **Added new abstract methods to `AttachmentFileUploader`**: The `AttachmentFileUploader` interface - now includes four new abstract methods (`uploadImage`, `uploadFile`, `removeImage`, `removeFile`). - Custom implementations must implement these methods. - -For more details, please refer to the [migration guide](../../migrations/v10-migration.md). - -โœ… Added - -- Added standalone file and image upload/removal methods for CDN operations: - - `StreamChatClient.uploadImage()` - Upload an image to the Stream CDN - - `StreamChatClient.uploadFile()` - Upload a file to the Stream CDN - - `StreamChatClient.removeImage()` - Remove an image from the Stream CDN - - `StreamChatClient.removeFile()` - Remove a file from the Stream CDN - ## 10.0.0-beta.6 - Included the changes from version [`9.17.0`](https://pub.dev/packages/stream_chat/changelog). @@ -172,10 +154,10 @@ For more details, please refer to the [migration guide](../../migrations/v10-mig - Added support for Channel pinning and archiving. - Added support for 'DraftMessage' feature, which allows users to save draft messages in channels. Several methods have been added to the `Client` and `Channel` class to manage draft messages: - - `channel.createDraft`: Saves a draft message for a specific channel. - - `channel.getDraft`: Retrieves a draft message for a specific channel. - - `channel.deleteDraft`: Deletes a draft message for a specific channel. - - `client.queryDrafts`: Queries draft messages created by the current user. + - `channel.createDraft`: Saves a draft message for a specific channel. + - `channel.getDraft`: Retrieves a draft message for a specific channel. + - `channel.deleteDraft`: Deletes a draft message for a specific channel. + - `client.queryDrafts`: Queries draft messages created by the current user. ๐Ÿž Fixed @@ -234,7 +216,7 @@ For more details, please refer to the [migration guide](../../migrations/v10-mig - [[#1774]](https://github.com/GetStream/stream-chat-flutter/issues/1774) Fixed failed to execute 'close' on 'WebSocket'. - [[#2016]](https://github.com/GetStream/stream-chat-flutter/issues/2016) Fix muted channel's unreadCount incorrectly updated. - + ๐Ÿ”„ Changed - Refactored identifying the `Attachment.uploadState` logic for local and remote attachments. Also updated the logic for determining the attachment type to check for ogScrapeUrl instead of `AttachmentType.giphy`. @@ -345,7 +327,7 @@ For more details, please refer to the [migration guide](../../migrations/v10-mig ๐Ÿž Fixed -- [[#1837]](https://github.com/GetStream/stream-chat-flutter/issues/1837) Delete image and file +- [[#1837]](https://github.com/GetStream/stream-chat-flutter/issues/1837) Delete image and file attachments from the CDN, when the message get's hard deleted. - [[#1819]](https://github.com/GetStream/stream-chat-flutter/issues/1819) Handle network errors with String payload. @@ -370,12 +352,12 @@ For more details, please refer to the [migration guide](../../migrations/v10-mig ๐Ÿ”„ Changed - Updated minimum supported `SDK` version to Flutter 3.13/Dart 3.1 - + # 6.10.0 ๐Ÿž Fixed -- [[#1753]](https://github.com/GetStream/stream-chat-flutter/issues/1753) Fixed Unhandled null +- [[#1753]](https://github.com/GetStream/stream-chat-flutter/issues/1753) Fixed Unhandled null check operator exception when user is removed from a channel. ## 6.9.0 @@ -841,12 +823,12 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra ๐Ÿ›‘๏ธ Breaking Changes from `2.2.1` - Added 6 new methods in `ChatPersistenceClient`. - - `bulkUpdateMessages` - - `bulkUpdatePinnedMessages` - - `bulkUpdateMembers` - - `bulkUpdateReads` - - `updatePinnedMessageReactions` - - `deletePinnedMessageReactionsByMessageId` + - `bulkUpdateMessages` + - `bulkUpdatePinnedMessages` + - `bulkUpdateMembers` + - `bulkUpdateReads` + - `updatePinnedMessageReactions` + - `deletePinnedMessageReactionsByMessageId` โœ… Added @@ -930,19 +912,19 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra - `ConnectUserWithProvider` now requires `tokenProvider` as a required parameter. (Removed from the constructor) - `client.disconnect()` is now divided into two different functions - - `client.closeConnection()` -> for closing user web socket connection. - - `client.disconnectUser()` -> for disconnecting user and resetting client state. + - `client.closeConnection()` -> for closing user web socket connection. + - `client.disconnectUser()` -> for disconnecting user and resetting client state. - `client.devToken()` now returns a `Token` model instead of `String`. - `ApiError` is removed in favor of `StreamChatError` - - `StreamChatError` -> parent type for all the stream errors. - - `StreamWebSocketError` -> for user web socket related errors. - - `StreamChatNetworkError` -> for network related errors. + - `StreamChatError` -> parent type for all the stream errors. + - `StreamWebSocketError` -> for user web socket related errors. + - `StreamChatNetworkError` -> for network related errors. - `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual parameters - - `option.state` -> bool state - - `option.watch` -> bool watch - - `option.presence` -> bool presence + - `option.state` -> bool state + - `option.watch` -> bool watch + - `option.presence` -> bool presence - `client.queryUsers()` options parameter is removed in favor of individual parameters - - `option.presence` -> bool presence + - `option.presence` -> bool presence - Migrate this package to null safety - Added typed filters @@ -978,19 +960,19 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra - `ConnectUserWithProvider` now requires `tokenProvider` as a required parameter. (Removed from the constructor) - `client.disconnect()` is now divided into two different functions - - `client.closeConnection()` -> for closing user web socket connection. - - `client.disconnectUser()` -> for disconnecting user and resetting client state. + - `client.closeConnection()` -> for closing user web socket connection. + - `client.disconnectUser()` -> for disconnecting user and resetting client state. - `client.devToken()` now returns a `Token` model instead of `String`. - `ApiError` is removed in favor of `StreamChatError` - - `StreamChatError` -> parent type for all the stream errors. - - `StreamWebSocketError` -> for user web socket related errors. - - `StreamChatNetworkError` -> for network related errors. + - `StreamChatError` -> parent type for all the stream errors. + - `StreamWebSocketError` -> for user web socket related errors. + - `StreamChatNetworkError` -> for network related errors. - `client.queryChannels()`, `channel.query()` options parameter is removed in favor of individual parameters - - `option.state` -> bool state - - `option.watch` -> bool watch - - `option.presence` -> bool presence + - `option.state` -> bool state + - `option.watch` -> bool watch + - `option.presence` -> bool presence - `client.queryUsers()` options parameter is removed in favor of individual parameters - - `option.presence` -> bool presence + - `option.presence` -> bool presence โœ… Added @@ -1556,4 +1538,4 @@ the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migra ## 0.0.2 -- first beta version \ No newline at end of file +- first beta version From 188cb689979e9403f1dd17173b89f57a18041e0e Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 25 Sep 2025 22:00:19 +0200 Subject: [PATCH 09/10] chore: update CHANGELOG.md --- packages/stream_chat/CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index c1402692f8..136dcf8930 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,21 @@ +## Upcoming Beta + +๐Ÿ›‘๏ธ Breaking + +- **Added new abstract methods to `AttachmentFileUploader`**: The `AttachmentFileUploader` interface + now includes four new abstract methods (`uploadImage`, `uploadFile`, `removeImage`, `removeFile`). + Custom implementations must implement these methods. + +For more details, please refer to the [migration guide](../../migrations/v10-migration.md). + +โœ… Added + +- Added standalone file and image upload/removal methods for CDN operations: + - `StreamChatClient.uploadImage()` - Upload an image to the Stream CDN + - `StreamChatClient.uploadFile()` - Upload a file to the Stream CDN + - `StreamChatClient.removeImage()` - Remove an image from the Stream CDN + - `StreamChatClient.removeFile()` - Remove a file from the Stream CDN + ## 10.0.0-beta.6 - Included the changes from version [`9.17.0`](https://pub.dev/packages/stream_chat/changelog). From e50277b9438741897e8d1c4396ea7210cd58b7fc Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 26 Sep 2025 17:17:04 +0200 Subject: [PATCH 10/10] chore: minor changes --- packages/stream_chat/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 2a7e704bf5..ce4e74bf97 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -25,7 +25,6 @@ For more details, please refer to the [migration guide](../../migrations/v10-mig - `StreamChatClient.removeImage()` - Remove an image from the Stream CDN - `StreamChatClient.removeFile()` - Remove a file from the Stream CDN - ## 10.0.0-beta.6 - Included the changes from version [`9.17.0`](https://pub.dev/packages/stream_chat/changelog).