From 9302bdd06ab8d25ef9dc6978770a1df247d439a6 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 11 Mar 2022 11:42:35 +0100 Subject: [PATCH 01/13] fix(llc): unread count specific to channel setting wrong number --- packages/stream_chat/lib/src/client/channel.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/stream_chat/lib/src/client/channel.dart b/packages/stream_chat/lib/src/client/channel.dart index 0493c0d7..f2effe04 100644 --- a/packages/stream_chat/lib/src/client/channel.dart +++ b/packages/stream_chat/lib/src/client/channel.dart @@ -1902,7 +1902,6 @@ class ChannelClientState { readList.add(Read( user: event.user!, lastRead: event.createdAt, - unreadMessages: event.totalUnreadCount ?? 0, )); _channelState = _channelState.copyWith(read: readList); } From 568431c9a2d19699d7eecf273bdb0417d6a4ddad Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 11 Mar 2022 11:43:18 +0100 Subject: [PATCH 02/13] chore(llc): update changelog --- packages/stream_chat/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index f8a5bee7..ccd95ccf 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,8 @@ +## Upcoming + +🐞 Fixed +- Unread count specific to channel setting global unread count on a specific case. + ## 3.5.0 ✅ Added From da4c568cbab8b6d0df79e7092cc10dcb826c4ea6 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 13:50:52 +0100 Subject: [PATCH 03/13] fix(llc): make ws reconnection more robust --- packages/stream_chat/lib/src/client/client.dart | 1 + packages/stream_chat/lib/src/ws/websocket.dart | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/lib/src/client/client.dart b/packages/stream_chat/lib/src/client/client.dart index c3605ac5..00b0433b 100644 --- a/packages/stream_chat/lib/src/client/client.dart +++ b/packages/stream_chat/lib/src/client/client.dart @@ -374,6 +374,7 @@ class StreamChatClient { final event = await _ws.connect(user); return user.merge(event.me); } catch (e, stk) { + _wsConnectionStatus = ConnectionStatus.disconnected; logger.severe('error connecting ws', e, stk); rethrow; } diff --git a/packages/stream_chat/lib/src/ws/websocket.dart b/packages/stream_chat/lib/src/ws/websocket.dart index 82c7d7c1..20d54879 100644 --- a/packages/stream_chat/lib/src/ws/websocket.dart +++ b/packages/stream_chat/lib/src/ws/websocket.dart @@ -190,8 +190,12 @@ class WebSocket with TimerHelper { _connectionStatus = ConnectionStatus.connecting; connectionCompleter = Completer(); - final uri = await _buildUri(); - _initWebSocketChannel(uri); + try { + final uri = await _buildUri(); + _initWebSocketChannel(uri); + } catch (e, stk) { + _onConnectionError(e, stk); + } return connectionCompleter!.future; } From f301a467bafc28b6321478e6184135cd5aeed179 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 13:51:31 +0100 Subject: [PATCH 04/13] chore(llc): update changelog --- packages/stream_chat/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index ccd95ccf..14f23f4c 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -2,6 +2,7 @@ 🐞 Fixed - Unread count specific to channel setting global unread count on a specific case. +- The reconnection logic for the ws is now more robust. ## 3.5.0 From 56b3506da35027bce26f6a6e3efc8ecd7e0384d4 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 15:56:26 +0100 Subject: [PATCH 05/13] fix(llc): ensure reconnection is automatic --- packages/stream_chat/lib/src/client/client.dart | 1 - packages/stream_chat/lib/src/ws/websocket.dart | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/lib/src/client/client.dart b/packages/stream_chat/lib/src/client/client.dart index 00b0433b..c3605ac5 100644 --- a/packages/stream_chat/lib/src/client/client.dart +++ b/packages/stream_chat/lib/src/client/client.dart @@ -374,7 +374,6 @@ class StreamChatClient { final event = await _ws.connect(user); return user.merge(event.me); } catch (e, stk) { - _wsConnectionStatus = ConnectionStatus.disconnected; logger.severe('error connecting ws', e, stk); rethrow; } diff --git a/packages/stream_chat/lib/src/ws/websocket.dart b/packages/stream_chat/lib/src/ws/websocket.dart index 20d54879..28f99fc5 100644 --- a/packages/stream_chat/lib/src/ws/websocket.dart +++ b/packages/stream_chat/lib/src/ws/websocket.dart @@ -112,6 +112,7 @@ class WebSocket with TimerHelper { if (_webSocketChannel != null) { _closeWebSocketChannel(); } + // throw Error(); _webSocketChannel = webSocketChannelProvider?.call(uri) ?? WebSocketChannel.connect(uri); _subscribeToWebSocketChannel(); @@ -220,7 +221,11 @@ class WebSocket with TimerHelper { Duration(milliseconds: delay), () async { final uri = await _buildUri(refreshToken: refreshToken); - _initWebSocketChannel(uri); + try { + _initWebSocketChannel(uri); + } catch (e, stk) { + _onConnectionError(e, stk); + } }, ); } From 8f7908f319952010f2613a0538bc594b909c4187 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 16:16:52 +0100 Subject: [PATCH 06/13] Update packages/stream_chat/lib/src/ws/websocket.dart Co-authored-by: Gordon --- packages/stream_chat/lib/src/ws/websocket.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/stream_chat/lib/src/ws/websocket.dart b/packages/stream_chat/lib/src/ws/websocket.dart index 28f99fc5..888ba08b 100644 --- a/packages/stream_chat/lib/src/ws/websocket.dart +++ b/packages/stream_chat/lib/src/ws/websocket.dart @@ -112,7 +112,6 @@ class WebSocket with TimerHelper { if (_webSocketChannel != null) { _closeWebSocketChannel(); } - // throw Error(); _webSocketChannel = webSocketChannelProvider?.call(uri) ?? WebSocketChannel.connect(uri); _subscribeToWebSocketChannel(); From 935f4bcc0344bdb7676e3c95a91d8e829ed41e93 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 17:20:01 +0100 Subject: [PATCH 07/13] chore(llc,core,ui): update pubspec and changelogs --- packages/stream_chat/CHANGELOG.md | 2 +- packages/stream_chat/lib/version.dart | 2 +- packages/stream_chat/pubspec.yaml | 4 ++-- packages/stream_chat_flutter/CHANGELOG.md | 3 ++- .../stream_chat_flutter/lib/src/media_list_view.dart | 7 +++++-- packages/stream_chat_flutter/lib/src/message_input.dart | 9 +++++---- packages/stream_chat_flutter/pubspec.yaml | 6 +++--- packages/stream_chat_flutter_core/CHANGELOG.md | 4 ++++ packages/stream_chat_flutter_core/pubspec.yaml | 2 +- 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 14f23f4c..a52f576e 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,4 +1,4 @@ -## Upcoming +## 3.5.1 🐞 Fixed - Unread count specific to channel setting global unread count on a specific case. diff --git a/packages/stream_chat/lib/version.dart b/packages/stream_chat/lib/version.dart index 0ae6a20a..8d0584a0 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 = '3.5.0'; +const PACKAGE_VERSION = '3.5.1'; diff --git a/packages/stream_chat/pubspec.yaml b/packages/stream_chat/pubspec.yaml index 6e6893c1..2e195f6b 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: 3.5.0 +version: 3.5.1 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -30,5 +30,5 @@ dev_dependencies: dart_code_metrics: ^4.4.0 freezed: ^1.0.0 json_serializable: ^6.0.1 - mocktail: ^0.2.0 + mocktail: ^0.3.0 test: ^1.17.12 \ No newline at end of file diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 15aea4b1..945749d7 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,8 +1,9 @@ -## Upcoming +## 3.5.1 🐞 Fixed - Mentions overlay now doesn't overflow when not enough height available +- Updated `stream_chat_flutter_core` dependency to [`3.5.1`](https://pub.dev/packages/stream_chat_flutter_core/changelog). ## 3.5.0 diff --git a/packages/stream_chat_flutter/lib/src/media_list_view.dart b/packages/stream_chat_flutter/lib/src/media_list_view.dart index d5a9233c..62072b0a 100644 --- a/packages/stream_chat_flutter/lib/src/media_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/media_list_view.dart @@ -158,7 +158,10 @@ class _MediaListViewState extends State { )) .firstOrNull; - final media = await assetList?.getAssetListPaged(_currentPage, 50); + final media = await assetList?.getAssetListPaged( + page: _currentPage, + size: 50, + ); if (media?.isNotEmpty == true) { setState(() { @@ -197,7 +200,7 @@ class MediaThumbnailProvider extends ImageProvider { DecoderCallback decode, ) async { assert(key == this, 'Checks MediaThumbnailProvider'); - final bytes = await media.thumbData; + final bytes = await media.thumbnailData; return decode(bytes!); } diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index bc08ebcd..afb2c749 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -1978,12 +1978,12 @@ class _PickerWidget extends StatefulWidget { } class _PickerWidgetState extends State<_PickerWidget> { - Future? requestPermission; + Future? requestPermission; @override void initState() { super.initState(); - requestPermission = PhotoManager.requestPermission(); + requestPermission = PhotoManager.requestPermissionExtend(); } @override @@ -1991,14 +1991,15 @@ class _PickerWidgetState extends State<_PickerWidget> { if (widget.filePickerIndex != 0) { return const Offstage(); } - return FutureBuilder( + return FutureBuilder( future: requestPermission, builder: (context, snapshot) { if (!snapshot.hasData) { return const Offstage(); } - if (snapshot.data!) { + if ([PermissionState.authorized, PermissionState.limited] + .contains(snapshot.data)) { if (widget.containsFile) { return GestureDetector( onTap: () { diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index c2d90eb0..f54cf183 100644 --- a/packages/stream_chat_flutter/pubspec.yaml +++ b/packages/stream_chat_flutter/pubspec.yaml @@ -31,10 +31,10 @@ dependencies: lottie: ^1.0.1 meta: ^1.3.0 path_provider: ^2.0.1 - photo_manager: ^1.2.6+1 + photo_manager: ^2.0.1 photo_view: ^0.13.0 rxdart: ^0.27.0 - share_plus: ^3.0.4 + share_plus: ^4.0.1 shimmer: ^2.0.0 stream_chat_flutter_core: ^3.5.0 substring_highlight: ^1.0.26 @@ -58,5 +58,5 @@ dev_dependencies: flutter_test: sdk: flutter golden_toolkit: ^0.13.0 - mocktail: ^0.2.0 + mocktail: ^0.3.0 path: ^1.8.0 diff --git a/packages/stream_chat_flutter_core/CHANGELOG.md b/packages/stream_chat_flutter_core/CHANGELOG.md index 1fa60708..d18b2ca0 100644 --- a/packages/stream_chat_flutter_core/CHANGELOG.md +++ b/packages/stream_chat_flutter_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.5.1 + +- Updated `stream_chat` dependency to [`3.5.1`](https://pub.dev/packages/stream_chat/changelog). + ## 3.5.0 - Updated `stream_chat` dependency to [`3.5.0`](https://pub.dev/packages/stream_chat/changelog). diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index b9d8e440..fd1e8363 100644 --- a/packages/stream_chat_flutter_core/pubspec.yaml +++ b/packages/stream_chat_flutter_core/pubspec.yaml @@ -23,5 +23,5 @@ dev_dependencies: fake_async: ^1.2.0 flutter_test: sdk: flutter - mocktail: ^0.2.0 + mocktail: ^0.3.0 From 8847a0b0bb32649aa6c79b8389cc840881c0e8ac Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 18:24:58 +0100 Subject: [PATCH 08/13] Update packages/stream_chat/lib/src/ws/websocket.dart Co-authored-by: Sacha Arbonel --- packages/stream_chat/lib/src/ws/websocket.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/stream_chat/lib/src/ws/websocket.dart b/packages/stream_chat/lib/src/ws/websocket.dart index 28f99fc5..888ba08b 100644 --- a/packages/stream_chat/lib/src/ws/websocket.dart +++ b/packages/stream_chat/lib/src/ws/websocket.dart @@ -112,7 +112,6 @@ class WebSocket with TimerHelper { if (_webSocketChannel != null) { _closeWebSocketChannel(); } - // throw Error(); _webSocketChannel = webSocketChannelProvider?.call(uri) ?? WebSocketChannel.connect(uri); _subscribeToWebSocketChannel(); From 766f03eb9421e1e361dc298821769365ed8aff60 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 18:30:37 +0100 Subject: [PATCH 09/13] Update packages/stream_chat_flutter/CHANGELOG.md Co-authored-by: Gordon --- packages/stream_chat_flutter/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 945749d7..2e81c800 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -2,7 +2,7 @@ 🐞 Fixed -- Mentions overlay now doesn't overflow when not enough height available +- Mentions overlay now doesn't overflow when there is not enough height available - Updated `stream_chat_flutter_core` dependency to [`3.5.1`](https://pub.dev/packages/stream_chat_flutter_core/changelog). ## 3.5.0 From 9bb7e5f0f3eb52c7c8a390badfb17cc341062fa3 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 18:30:44 +0100 Subject: [PATCH 10/13] Update packages/stream_chat/CHANGELOG.md Co-authored-by: Gordon --- 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 a52f576e..2a6e2e81 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -2,7 +2,7 @@ 🐞 Fixed - Unread count specific to channel setting global unread count on a specific case. -- The reconnection logic for the ws is now more robust. +- The reconnection logic for the WebSocket connection is now more robust. ## 3.5.0 From 6d4e3d76e03df4484e45929b1673dc896e1d726f Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 15 Mar 2022 18:36:18 +0100 Subject: [PATCH 11/13] Update packages/stream_chat/CHANGELOG.md Co-authored-by: Gordon --- 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 2a6e2e81..a74b920e 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,7 +1,7 @@ ## 3.5.1 🐞 Fixed -- Unread count specific to channel setting global unread count on a specific case. +- `channel.unreadCount` was being set as using global unread count on a very specific case. - The reconnection logic for the WebSocket connection is now more robust. ## 3.5.0 From 3620e57f9872999a046f773a67e2ef5fe3b3e240 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 16 Mar 2022 09:05:50 +0100 Subject: [PATCH 12/13] chore(core,ui): update pubspec version --- packages/stream_chat_flutter/pubspec.yaml | 4 ++-- packages/stream_chat_flutter_core/pubspec.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index f54cf183..2abc216f 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: 3.5.0 +version: 3.5.1 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: ^3.5.0 + stream_chat_flutter_core: ^3.5.1 substring_highlight: ^1.0.26 synchronized: ^3.0.0 url_launcher: ^6.0.3 diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index fd1e8363..3fde274b 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: 3.5.0 +version: 3.5.1 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -16,7 +16,7 @@ dependencies: sdk: flutter meta: ^1.3.0 rxdart: ^0.27.0 - stream_chat: ^3.5.0 + stream_chat: ^3.5.1 dev_dependencies: dart_code_metrics: ^4.4.0 From 04194cf3ee47b499b349afff07603f662ad29e21 Mon Sep 17 00:00:00 2001 From: GroovinChip Date: Wed, 16 Mar 2022 15:15:49 -0400 Subject: [PATCH 13/13] chore(flutter): don't run actions on draft PR's --- .github/workflows/stream_flutter_workflow.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/stream_flutter_workflow.yml b/.github/workflows/stream_flutter_workflow.yml index 16be547c..33298866 100644 --- a/.github/workflows/stream_flutter_workflow.yml +++ b/.github/workflows/stream_flutter_workflow.yml @@ -15,6 +15,7 @@ on: jobs: analyze: timeout-minutes: 15 + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - name: "Git Checkout" @@ -45,6 +46,7 @@ jobs: format: runs-on: ubuntu-latest + if: github.event.pull_request.draft == false timeout-minutes: 15 steps: - name: "Git Checkout" @@ -73,6 +75,7 @@ jobs: test: runs-on: macos-latest + if: github.event.pull_request.draft == false timeout-minutes: 20 steps: - name: "Git Checkout" @@ -123,3 +126,12 @@ jobs: with: path: packages/stream_chat_flutter/coverage/lcov.info min_coverage: 67 + + draft-build: + runs-on: ubuntu-latest + if: github.event.pull_request.draft == true + timeout-minutes: 1 + + steps: + - name: Run a one-line script + run: echo Draft PR, you are good. \ No newline at end of file