From ac64e223c6133d6b3cba9da420a2216e4b101bb0 Mon Sep 17 00:00:00 2001 From: Efthymis Sarmpanis Date: Fri, 24 Nov 2023 13:16:19 +0200 Subject: [PATCH 1/4] chore(repo): lock the flutter version of pipelines --- .github/workflows/stream_flutter_workflow.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/stream_flutter_workflow.yml b/.github/workflows/stream_flutter_workflow.yml index 5665818f..11e68ec7 100644 --- a/.github/workflows/stream_flutter_workflow.yml +++ b/.github/workflows/stream_flutter_workflow.yml @@ -3,6 +3,7 @@ name: stream_flutter_workflow env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' flutter_channel: "stable" + flutter_version: "3.10.6" on: pull_request: @@ -36,6 +37,7 @@ jobs: - name: "Install Flutter" uses: subosito/flutter-action@v2 with: + flutter-version: ${{ env.flutter_version }} cache: true channel: ${{ env.flutter_channel }} - name: "Install Tools" @@ -63,6 +65,7 @@ jobs: - name: "Install Flutter" uses: subosito/flutter-action@v2 with: + flutter-version: ${{ env.flutter_version }} cache: true channel: ${{ env.flutter_channel }} - name: "Install Tools" @@ -88,6 +91,7 @@ jobs: - name: "Install Flutter" uses: subosito/flutter-action@v2 with: + flutter-version: ${{ env.flutter_version }} cache: true channel: ${{ env.flutter_channel }} - name: "Install Tools" From 3b1be70b107f19499752c462193cde8ed970056b Mon Sep 17 00:00:00 2001 From: Efthymis Sarmpanis Date: Fri, 24 Nov 2023 13:22:29 +0200 Subject: [PATCH 2/4] fix(repo): fix broken test --- .../test/src/core/http/stream_http_client_test.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat/test/src/core/http/stream_http_client_test.dart b/packages/stream_chat/test/src/core/http/stream_http_client_test.dart index f63e08f1..2ddc84e3 100644 --- a/packages/stream_chat/test/src/core/http/stream_http_client_test.dart +++ b/packages/stream_chat/test/src/core/http/stream_http_client_test.dart @@ -164,7 +164,8 @@ void main() { expect( e.message, "The connection errored: Dio can't establish a new connection" - ' after it was closed.', + ' after it was closed. This indicates an error which most likely' + ' cannot be solved by the library.', ); } }); From 0d7559e3d8d96b78ab6b7618d4ace73c52d23c3d Mon Sep 17 00:00:00 2001 From: Efthymis Sarmpanis Date: Thu, 23 Nov 2023 12:52:34 +0200 Subject: [PATCH 3/4] fix(llc): when removing current user from channel check for null in the callback Closes #1753 --- packages/stream_chat/CHANGELOG.md | 2 + .../stream_chat/lib/src/client/client.dart | 2 +- .../example/lib/debug/actions/add_user.dart | 47 +++++++++++++++++++ .../lib/debug/actions/remove_user.dart | 47 +++++++++++++++++++ .../example/lib/debug/channel_page.dart | 6 +++ 5 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 packages/stream_chat_flutter/example/lib/debug/actions/add_user.dart create mode 100644 packages/stream_chat_flutter/example/lib/debug/actions/remove_user.dart diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index c1537e5c..88f3ee19 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -6,6 +6,8 @@ update message with `type: reply`. - [[#1724]](https://github.com/GetStream/stream-chat-flutter/issues/1724) Fixed sendFile error on `AttachmentFile` with `bytes` and no `name`. +- [[#1753]](https://github.com/GetStream/stream-chat-flutter/issues/1753) Fixed Unhandled null + check operator exception when user is removed from a channel. ## 6.8.0 diff --git a/packages/stream_chat/lib/src/client/client.dart b/packages/stream_chat/lib/src/client/client.dart index 4e4fc5e4..79bf1741 100644 --- a/packages/stream_chat/lib/src/client/client.dart +++ b/packages/stream_chat/lib/src/client/client.dart @@ -1658,7 +1658,7 @@ class ClientState { ) .listen((event) async { final isCurrentUser = event.user!.id == currentUser!.id; - if (isCurrentUser) { + if (isCurrentUser && event.channel != null) { final eventChannel = event.channel!; await _client.chatPersistenceClient ?.deleteChannels([eventChannel.cid]); diff --git a/packages/stream_chat_flutter/example/lib/debug/actions/add_user.dart b/packages/stream_chat_flutter/example/lib/debug/actions/add_user.dart new file mode 100644 index 00000000..74fe2624 --- /dev/null +++ b/packages/stream_chat_flutter/example/lib/debug/actions/add_user.dart @@ -0,0 +1,47 @@ +// ignore_for_file: public_member_api_docs + +import 'package:flutter/material.dart'; +import 'package:stream_chat_flutter/stream_chat_flutter.dart'; + +import 'package:stream_chat_flutter_example/debug/error_dialog.dart'; + +class DebugAddUser extends StatelessWidget { + const DebugAddUser({ + super.key, + required this.client, + required this.channel, + }); + + final StreamChatClient client; + final Channel channel; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(8), + child: TextField( + decoration: const InputDecoration( + labelText: 'Add User', + hintText: 'User Id', + isDense: true, + border: OutlineInputBorder(), + ), + onSubmitted: (value) async { + final userId = value.trim(); + try { + debugPrint('[addUser] userId: $userId'); + final result = await client.addChannelMembers( + channel.id!, + channel.type, + [userId], + ); + debugPrint('[addUser] result: $result'); + } catch (e) { + debugPrint('[addUser] failed: $e'); + showErrorDialog(context, e, 'Add User'); + } + }, + ), + ); + } +} diff --git a/packages/stream_chat_flutter/example/lib/debug/actions/remove_user.dart b/packages/stream_chat_flutter/example/lib/debug/actions/remove_user.dart new file mode 100644 index 00000000..9aee373c --- /dev/null +++ b/packages/stream_chat_flutter/example/lib/debug/actions/remove_user.dart @@ -0,0 +1,47 @@ +// ignore_for_file: public_member_api_docs + +import 'package:flutter/material.dart'; +import 'package:stream_chat_flutter/stream_chat_flutter.dart'; + +import 'package:stream_chat_flutter_example/debug/error_dialog.dart'; + +class DebugRemoveUser extends StatelessWidget { + const DebugRemoveUser({ + super.key, + required this.client, + required this.channel, + }); + + final StreamChatClient client; + final Channel channel; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(8), + child: TextField( + decoration: const InputDecoration( + labelText: 'Remove User', + hintText: 'User Id', + isDense: true, + border: OutlineInputBorder(), + ), + onSubmitted: (value) async { + final userId = value.trim(); + try { + debugPrint('[removeUser] userId: $userId'); + final result = await client.removeChannelMembers( + channel.id!, + channel.type, + [userId], + ); + debugPrint('[removeUser] result: $result'); + } catch (e) { + debugPrint('[removeUser] failed: $e'); + showErrorDialog(context, e, 'Remove User'); + } + }, + ), + ); + } +} diff --git a/packages/stream_chat_flutter/example/lib/debug/channel_page.dart b/packages/stream_chat_flutter/example/lib/debug/channel_page.dart index b5e93cf5..a1d4b6a4 100644 --- a/packages/stream_chat_flutter/example/lib/debug/channel_page.dart +++ b/packages/stream_chat_flutter/example/lib/debug/channel_page.dart @@ -4,9 +4,11 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:stream_chat_flutter/stream_chat_flutter.dart'; +import 'package:stream_chat_flutter_example/debug/actions/add_user.dart'; import 'package:stream_chat_flutter_example/debug/actions/ban_user.dart'; import 'package:stream_chat_flutter_example/debug/actions/mute_user.dart'; import 'package:stream_chat_flutter_example/debug/actions/remove_shadow_ban.dart'; +import 'package:stream_chat_flutter_example/debug/actions/remove_user.dart'; import 'package:stream_chat_flutter_example/debug/actions/shadow_ban.dart'; import 'package:stream_chat_flutter_example/debug/actions/unban_user.dart'; import 'package:stream_chat_flutter_example/debug/actions/unmute_user.dart'; @@ -82,6 +84,10 @@ class _DebugChannelPageState extends State { DebugShadowBan(client: _channel.client), const SizedBox(height: 8), DebugRemoveShadowBan(client: _channel.client), + const SizedBox(height: 8), + DebugAddUser(client: _channel.client, channel: _channel), + const SizedBox(height: 8), + DebugRemoveUser(client: _channel.client, channel: _channel), ], ), ), From 6d22158b34c659d749ca00d4b6067a23a2ad318c Mon Sep 17 00:00:00 2001 From: Efthymis Sarmpanis Date: Fri, 24 Nov 2023 14:14:34 +0200 Subject: [PATCH 4/4] Release: v6.12.0 --- packages/stream_chat/CHANGELOG.md | 9 +++++++-- packages/stream_chat/lib/version.dart | 2 +- packages/stream_chat/pubspec.yaml | 2 +- packages/stream_chat_flutter/CHANGELOG.md | 2 +- packages/stream_chat_flutter/pubspec.yaml | 4 ++-- packages/stream_chat_flutter_core/CHANGELOG.md | 2 +- packages/stream_chat_flutter_core/pubspec.yaml | 4 ++-- packages/stream_chat_localizations/CHANGELOG.md | 4 ++++ packages/stream_chat_localizations/pubspec.yaml | 4 ++-- packages/stream_chat_persistence/CHANGELOG.md | 4 ++++ packages/stream_chat_persistence/pubspec.yaml | 4 ++-- 11 files changed, 27 insertions(+), 14 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 88f3ee19..142b5977 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,10 @@ +# 6.10.0 + +🐞 Fixed + +- [[#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 🐞 Fixed @@ -6,8 +13,6 @@ update message with `type: reply`. - [[#1724]](https://github.com/GetStream/stream-chat-flutter/issues/1724) Fixed sendFile error on `AttachmentFile` with `bytes` and no `name`. -- [[#1753]](https://github.com/GetStream/stream-chat-flutter/issues/1753) Fixed Unhandled null - check operator exception when user is removed from a channel. ## 6.8.0 diff --git a/packages/stream_chat/lib/version.dart b/packages/stream_chat/lib/version.dart index 18b77e8d..469f80df 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 = '6.9.0'; +const PACKAGE_VERSION = '6.10.0'; diff --git a/packages/stream_chat/pubspec.yaml b/packages/stream_chat/pubspec.yaml index 458cbd14..107f5c44 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: 6.9.0 +version: 6.10.0 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 eab50c35..c3a93e66 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -# Upcoming +# 6.12.0 🐞 Fixed diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index 1f4390a4..9a9d228e 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: 6.11.0 +version: 6.12.0 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -38,7 +38,7 @@ dependencies: rxdart: ^0.27.7 share_plus: ^7.1.0 shimmer: ^3.0.0 - stream_chat_flutter_core: ^6.10.0 + stream_chat_flutter_core: ^6.11.0 synchronized: ^3.1.0 thumblr: ^0.0.4 url_launcher: ^6.1.12 diff --git a/packages/stream_chat_flutter_core/CHANGELOG.md b/packages/stream_chat_flutter_core/CHANGELOG.md index 23ad62ef..a68bb7a6 100644 --- a/packages/stream_chat_flutter_core/CHANGELOG.md +++ b/packages/stream_chat_flutter_core/CHANGELOG.md @@ -1,4 +1,4 @@ -## UNRELEASED +## 6.11.0 🐞 Fixed diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index f3e1124b..e16ded8f 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: 6.10.0 +version: 6.11.0 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: ^2.4.1 meta: ^1.9.1 rxdart: ^0.27.7 - stream_chat: ^6.9.0 + stream_chat: ^6.10.0 dev_dependencies: build_runner: ^2.4.6 diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 35b78698..92519d7f 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.12.0 + +* Updated `stream_chat_flutter` dependency to [`6.12.0`](https://pub.dev/packages/stream_chat_flutter/changelog). + ## 5.11.0 * Updated `stream_chat_flutter` dependency to [`6.11.0`](https://pub.dev/packages/stream_chat_flutter/changelog). diff --git a/packages/stream_chat_localizations/pubspec.yaml b/packages/stream_chat_localizations/pubspec.yaml index 5daf3735..2b415c45 100644 --- a/packages/stream_chat_localizations/pubspec.yaml +++ b/packages/stream_chat_localizations/pubspec.yaml @@ -1,6 +1,6 @@ name: stream_chat_localizations description: The Official localizations for Stream Chat Flutter, a service for building chat applications -version: 5.11.0 +version: 5.12.0 homepage: https://github.com/GetStream/stream-chat-flutter repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -14,7 +14,7 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter - stream_chat_flutter: ^6.11.0 + stream_chat_flutter: ^6.12.0 dev_dependencies: flutter_test: diff --git a/packages/stream_chat_persistence/CHANGELOG.md b/packages/stream_chat_persistence/CHANGELOG.md index 3fe32092..51622650 100644 --- a/packages/stream_chat_persistence/CHANGELOG.md +++ b/packages/stream_chat_persistence/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.10.0 + +- Updated `stream_chat` dependency to [`6.10.0`](https://pub.dev/packages/stream_chat/changelog). + ## 6.9.0 - Updated `stream_chat` dependency to [`6.9.0`](https://pub.dev/packages/stream_chat/changelog). diff --git a/packages/stream_chat_persistence/pubspec.yaml b/packages/stream_chat_persistence/pubspec.yaml index fc4e85eb..38d7537a 100644 --- a/packages/stream_chat_persistence/pubspec.yaml +++ b/packages/stream_chat_persistence/pubspec.yaml @@ -1,7 +1,7 @@ name: stream_chat_persistence homepage: https://github.com/GetStream/stream-chat-flutter description: Official Stream Chat Persistence library. Build your own chat experience using Dart and Flutter. -version: 6.9.0 +version: 6.10.0 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues @@ -18,7 +18,7 @@ dependencies: path: ^1.8.3 path_provider: ^2.1.0 sqlite3_flutter_libs: ^0.5.15 - stream_chat: ^6.9.0 + stream_chat: ^6.10.0 dev_dependencies: build_runner: ^2.4.6