From 1926076598f5775da1585c864b68aedffc14baeb Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 13 Apr 2022 17:08:27 +0200 Subject: [PATCH 1/5] chore(llc,core,ui): update pubspec and changelogs --- packages/stream_chat/CHANGELOG.md | 18 ++++++++++++++++++ packages/stream_chat/lib/version.dart | 2 +- packages/stream_chat/pubspec.yaml | 2 +- packages/stream_chat_flutter/CHANGELOG.md | 9 ++++++++- packages/stream_chat_flutter/pubspec.yaml | 4 ++-- packages/stream_chat_flutter_core/CHANGELOG.md | 4 ++++ packages/stream_chat_flutter_core/pubspec.yaml | 4 ++-- 7 files changed, 36 insertions(+), 7 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index a4de2b674..27caf39e3 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,21 @@ +## 4.0.0-beta.2 + +🐞 Fixed + +- Fixed reactions not working for threads in offline mode. +- [[#1046]](https://github.com/GetStream/stream-chat-flutter/issues/1046) After `/mute` command on reload cannot access + any channel. +- [[#1047]](https://github.com/GetStream/stream-chat-flutter/issues/1047) `own_capabilities` extraData missing after + channel update. +- [[#1054]](https://github.com/GetStream/stream-chat-flutter/issues/1054) Fix `Unsupported operation: Cannot remove from an unmodifiable list`. +- [[#1033]](https://github.com/GetStream/stream-chat-flutter/issues/1033) Hard delete from dashboard does not delete message from client. +- Send only `user_id` while reconnecting. + +✅ Added + +- Handle `event.message` in `channel.truncate` events +- Added additional parameters to `channel.truncate` + ## 4.0.0-beta.0 ✅ Added diff --git a/packages/stream_chat/lib/version.dart b/packages/stream_chat/lib/version.dart index 533df1ce6..cc799a9a7 100644 --- a/packages/stream_chat/lib/version.dart +++ b/packages/stream_chat/lib/version.dart @@ -3,4 +3,4 @@ import 'package:stream_chat/src/client/client.dart'; /// Current package version /// Used in [StreamChatClient] to build the `x-stream-client` header // ignore: constant_identifier_names -const PACKAGE_VERSION = '4.0.0-beta.0'; +const PACKAGE_VERSION = '4.0.0-beta.2'; diff --git a/packages/stream_chat/pubspec.yaml b/packages/stream_chat/pubspec.yaml index bf2c84e6c..9ba44ec45 100644 --- a/packages/stream_chat/pubspec.yaml +++ b/packages/stream_chat/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat homepage: https://getstream.io/ description: The official Dart client for Stream Chat, a service for building chat applications. -version: 4.0.0-beta.0 +version: 4.0.0-beta.2 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 1550bb5f6..7407f7bc1 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -## Upcoming +## 4.0.0-beta.2 ✅ Added @@ -6,6 +6,13 @@ - Added support to control the visibility of the default emoji suggestions overlay - Added support to build custom widget for scrollToBottom in `StreamMessageListView` +🐞 Fixed + +- Minor fixes and improvements +-[[#892]](https://github.com/GetStream/stream-chat-flutter/issues/892): Fix default `initialAlignment` in `MessageListView`. +- Fix `MessageInputTheme.inputBackgroundColor` color not being used in some widgets of `MessageInput` +- Removed dependency on `visibility_detector` + ## 4.0.0-beta.1 ✅ Added diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index e0ba6fd84..fe5a73b45 100644 --- a/packages/stream_chat_flutter/pubspec.yaml +++ b/packages/stream_chat_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. -version: 4.0.0-beta.1 +version: 4.0.0-beta.2 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -36,7 +36,7 @@ dependencies: rxdart: ^0.27.0 share_plus: ^4.0.1 shimmer: ^2.0.0 - stream_chat_flutter_core: ^4.0.0-beta.0 + stream_chat_flutter_core: ^4.0.0-beta.2 substring_highlight: ^1.0.26 url_launcher: ^6.0.3 video_player: ^2.1.0 diff --git a/packages/stream_chat_flutter_core/CHANGELOG.md b/packages/stream_chat_flutter_core/CHANGELOG.md index 703e32949..26178eef5 100644 --- a/packages/stream_chat_flutter_core/CHANGELOG.md +++ b/packages/stream_chat_flutter_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.0-beta.2 + +- Updated `stream_chat` dependency to [`4.0.0-beta.2`](https://pub.dev/packages/stream_chat/changelog). + ## 4.0.0-beta.0 ✅ Added diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index 4e5e39b7e..ad41ad583 100644 --- a/packages/stream_chat_flutter_core/pubspec.yaml +++ b/packages/stream_chat_flutter_core/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_flutter_core homepage: https://github.com/GetStream/stream-chat-flutter description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter. -version: 4.0.0-beta.0 +version: 4.0.0-beta.2 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -17,7 +17,7 @@ dependencies: freezed_annotation: ^1.0.0 meta: ^1.3.0 rxdart: ^0.27.0 - stream_chat: ^4.0.0-beta.0 + stream_chat: ^4.0.0-beta.2 dev_dependencies: build_runner: ^2.0.1 From 2e8d663dac9670bd29909f1a3b036b19b6596806 Mon Sep 17 00:00:00 2001 From: Ayush Shekhar Date: Wed, 13 Apr 2022 20:46:57 +0530 Subject: [PATCH 2/5] Added attachment change update to changelog --- packages/stream_chat_flutter/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 7407f7bc1..7e9fa4cf0 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -12,6 +12,7 @@ -[[#892]](https://github.com/GetStream/stream-chat-flutter/issues/892): Fix default `initialAlignment` in `MessageListView`. - Fix `MessageInputTheme.inputBackgroundColor` color not being used in some widgets of `MessageInput` - Removed dependency on `visibility_detector` +- [[#1071]](https://github.com/GetStream/stream-chat-flutter/issues/1071): Fixed the way attachment actions were handled in full screen ## 4.0.0-beta.1 From affe37e684f58562b7337332238813b77c9e707d Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 14 Apr 2022 10:10:21 +0200 Subject: [PATCH 3/5] fix(ui): align new widgets to develop fixes --- packages/stream_chat/CHANGELOG.md | 1 - packages/stream_chat_flutter/CHANGELOG.md | 2 +- .../lib/src/v4/message_input/stream_message_input.dart | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 30fcd45ab..a390a823e 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -10,7 +10,6 @@ - [[#1054]](https://github.com/GetStream/stream-chat-flutter/issues/1054) Fix `Unsupported operation: Cannot remove from an unmodifiable list`. - [[#1033]](https://github.com/GetStream/stream-chat-flutter/issues/1033) Hard delete from dashboard does not delete message from client. - Send only `user_id` while reconnecting. -- [[#1081]](https://github.com/GetStream/stream-chat-flutter/issues/1081) Fixed a bug with user reconnection. ✅ Added diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 183efd7c5..ef980e29c 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -3,7 +3,7 @@ ✅ Added - Added support to pass `autoCorrect` to `StreamMessageInput` for the text input field -- Added support to control the visibility of the default emoji suggestions overlay +- Added support to control the visibility of the default emoji suggestions overlay in `StreamMessageInput` - Added support to build custom widget for scrollToBottom in `StreamMessageListView` 🐞 Fixed diff --git a/packages/stream_chat_flutter/lib/src/v4/message_input/stream_message_input.dart b/packages/stream_chat_flutter/lib/src/v4/message_input/stream_message_input.dart index a78f9b372..63872fc28 100644 --- a/packages/stream_chat_flutter/lib/src/v4/message_input/stream_message_input.dart +++ b/packages/stream_chat_flutter/lib/src/v4/message_input/stream_message_input.dart @@ -593,6 +593,7 @@ class StreamMessageInputState extends State elevation: widget.elevation ?? _streamChatTheme.messageInputTheme.elevation ?? 8, + color: _messageInputTheme.inputBackgroundColor, child: child, ); } @@ -789,6 +790,7 @@ class StreamMessageInputState extends State gradient: _focusNode.hasFocus ? _messageInputTheme.activeBorderGradient : _messageInputTheme.idleBorderGradient, + color: _messageInputTheme.inputBackgroundColor, ), child: Padding( padding: const EdgeInsets.all(1.5), From 478033078fd65b85819e0315f91b9147ce6d8db4 Mon Sep 17 00:00:00 2001 From: Ayush Shekhar Date: Thu, 14 Apr 2022 14:37:39 +0530 Subject: [PATCH 4/5] Fixed failing tests --- packages/stream_chat_flutter/pubspec.yaml | 4 ---- .../src/attachment_actions_modal_test.dart | 22 ++++++++++--------- .../src/theme/gallery_header_theme_test.dart | 22 +++++++++++++++++-- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index 667c031ba..e0ba6fd84 100644 --- a/packages/stream_chat_flutter/pubspec.yaml +++ b/packages/stream_chat_flutter/pubspec.yaml @@ -36,11 +36,7 @@ dependencies: rxdart: ^0.27.0 share_plus: ^4.0.1 shimmer: ^2.0.0 -<<<<<<< HEAD stream_chat_flutter_core: ^4.0.0-beta.0 -======= - stream_chat_flutter_core: ^3.6.1 ->>>>>>> develop substring_highlight: ^1.0.26 url_launcher: ^6.0.3 video_player: ^2.1.0 diff --git a/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart b/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart index 2d42f5588..d59b80028 100644 --- a/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart +++ b/packages/stream_chat_flutter/test/src/attachment_actions_modal_test.dart @@ -452,15 +452,16 @@ void main() { await tester.tap(find.text('Save Image')); - imageDownloader.progressCallback!(0, 100); + imageDownloader.progressCallback!(0, 100000); await tester.pump(); - expect(find.text('0%'), findsOneWidget); + expect(find.text('0.00 MB'), findsOneWidget); - imageDownloader.progressCallback!(50, 100); + imageDownloader.progressCallback!(50000, 100000); await tester.pump(); - expect(find.text('50%'), findsOneWidget); + expect(find.text('0.05 MB'), findsOneWidget); - imageDownloader.progressCallback!(100, 100); + imageDownloader.progressCallback!(100000, 100000); + imageDownloader.downloadedPathCallback!('path'); imageDownloader.completer.complete('path'); await tester.pump(); expect(find.byKey(const Key('completedIcon')), findsOneWidget); @@ -510,15 +511,16 @@ void main() { await tester.tap(find.text('Save Video')); - fileDownloader.progressCallback!(0, 100); + fileDownloader.progressCallback!(0, 100000); await tester.pump(); - expect(find.text('0%'), findsOneWidget); + expect(find.text('0.00 MB'), findsOneWidget); - fileDownloader.progressCallback!(50, 100); + fileDownloader.progressCallback!(50000, 100000); await tester.pump(); - expect(find.text('50%'), findsOneWidget); + expect(find.text('0.05 MB'), findsOneWidget); - fileDownloader.progressCallback!(100, 100); + fileDownloader.progressCallback!(100000, 100000); + fileDownloader.downloadedPathCallback!('path'); fileDownloader.completer.complete('path'); await tester.pump(); expect(find.byKey(const Key('completedIcon')), findsOneWidget); diff --git a/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart b/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart index 50be7d57b..651da1ce1 100644 --- a/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart +++ b/packages/stream_chat_flutter/test/src/theme/gallery_header_theme_test.dart @@ -66,7 +66,16 @@ void main() { home: Builder( builder: (context) { _context = context; - final _message = Message(); + final attachment = Attachment( + type: 'video', + title: 'video.mp4', + ); + final _message = Message( + createdAt: DateTime.now(), + attachments: [ + attachment, + ], + ); return Scaffold( appBar: StreamGalleryHeader( message: _message, @@ -107,7 +116,16 @@ void main() { home: Builder( builder: (context) { _context = context; - final _message = Message(); + final attachment = Attachment( + type: 'video', + title: 'video.mp4', + ); + final _message = Message( + createdAt: DateTime.now(), + attachments: [ + attachment, + ], + ); return Scaffold( appBar: StreamGalleryHeader( message: _message, From da4fd16af7c38ebfd396b9d220dea8432909d6f9 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 14 Apr 2022 11:32:32 +0200 Subject: [PATCH 5/5] add test --- .../test/src/ws/websocket_test.dart | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat/test/src/ws/websocket_test.dart b/packages/stream_chat/test/src/ws/websocket_test.dart index 5519b2b3d..68242333f 100644 --- a/packages/stream_chat/test/src/ws/websocket_test.dart +++ b/packages/stream_chat/test/src/ws/websocket_test.dart @@ -59,7 +59,10 @@ void main() { }); test('`connect` successfully with the provided user', () async { - final user = OwnUser(id: 'test-user'); + final user = OwnUser( + id: 'test-user', + name: 'test', + ); const connectionId = 'test-connection-id'; // Sends connect event to web-socket stream final timer = Timer(const Duration(milliseconds: 300), () { @@ -90,6 +93,44 @@ void main() { addTearDown(timer.cancel); }); + test('`connect` successfully without user details', () async { + final user = OwnUser( + id: 'test-user', + name: 'test', + ); + const connectionId = 'test-connection-id'; + // Sends connect event to web-socket stream + final timer = Timer(const Duration(milliseconds: 300), () { + final event = Event( + type: EventType.healthCheck, + connectionId: connectionId, + me: user, + ); + webSocketSink.add(json.encode(event)); + }); + + expectLater( + webSocket.connectionStatusStream, + emitsInOrder([ + ConnectionStatus.disconnected, + ConnectionStatus.connecting, + ConnectionStatus.connected, + ]), + ); + + final event = await webSocket.connect( + user, + includeUserDetails: true, + ); + + expect(event.type, EventType.healthCheck); + expect(event.connectionId, connectionId); + expect(event.me, isNotNull); + expect(event.me!.id, user.id); + + addTearDown(timer.cancel); + }); + test('`connect` should throw if already in connection attempt', () async { final user = OwnUser(id: 'test-user'); webSocket.connect(user);