From 4cd86278b582853762cd4baf05986772dce59aa6 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 30 Apr 2021 11:48:38 +0200 Subject: [PATCH 1/5] fix persistence sort filtering --- .../lib/src/dao/channel_query_dao.dart | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/stream_chat_persistence/lib/src/dao/channel_query_dao.dart b/packages/stream_chat_persistence/lib/src/dao/channel_query_dao.dart index 233fd4ef9..2010ab895 100644 --- a/packages/stream_chat_persistence/lib/src/dao/channel_query_dao.dart +++ b/packages/stream_chat_persistence/lib/src/dao/channel_query_dao.dart @@ -91,16 +91,6 @@ class ChannelQueryDao extends DatabaseAccessor return channelEntity.toChannelModel(createdBy: createdByEntity?.toUser()); })).get(); - final possibleSortingFields = cachedChannels.fold>( - ChannelModel.topLevelFields, - (previousValue, element) => - {...previousValue, ...element.extraData.keys}.toList()); - - // ignore: parameter_assignments - sort = sort - ?.where((s) => possibleSortingFields.contains(s.field)) - ?.toList(growable: false); - var chainedComparator = (ChannelModel a, ChannelModel b) { final dateA = a.lastMessageAt ?? a.createdAt; final dateB = b.lastMessageAt ?? b.createdAt; From c699fea7892b6118a367c5dbe656ec7a59379f0f Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 30 Apr 2021 11:49:20 +0200 Subject: [PATCH 2/5] do not await persistence and resync when connecting --- packages/stream_chat/lib/src/client.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/lib/src/client.dart b/packages/stream_chat/lib/src/client.dart index 657fb113e..21e90b212 100644 --- a/packages/stream_chat/lib/src/client.dart +++ b/packages/stream_chat/lib/src/client.dart @@ -547,9 +547,9 @@ class StreamChatClient { var event = await _chatPersistenceClient?.getConnectionInfo(); await _ws.connect().then((e) async { - await _chatPersistenceClient?.updateConnectionInfo(e); + _chatPersistenceClient?.updateConnectionInfo(e); event = e; - await resync(); + resync(); }).catchError((err, stacktrace) { logger.severe('error connecting ws', err, stacktrace); if (err is Map) { From ba293987e6dd38cf7ad914826e9988239ab8f0ec Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 30 Apr 2021 11:52:26 +0200 Subject: [PATCH 3/5] bump version and chanelogs --- packages/stream_chat/CHANGELOG.md | 4 ++++ packages/stream_chat/lib/version.dart | 2 +- packages/stream_chat/pubspec.yaml | 2 +- packages/stream_chat_flutter/CHANGELOG.md | 4 ++++ packages/stream_chat_flutter/pubspec.yaml | 2 +- packages/stream_chat_flutter_core/CHANGELOG.md | 4 ++++ packages/stream_chat_flutter_core/pubspec.yaml | 2 +- packages/stream_chat_persistence/CHANGELOG.md | 4 ++++ packages/stream_chat_persistence/pubspec.yaml | 2 +- 9 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index c95091b41..d6d08a3c6 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.3 + +- fix: `StreamChatClient.connect` returns quicker when you're using the persistence package + ## 1.5.2 - fix: `queryChannels` should throw exceptions only if no data is present in cache. diff --git a/packages/stream_chat/lib/version.dart b/packages/stream_chat/lib/version.dart index 948ae1df1..a18852e11 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.dart'; /// Current package version /// Used in [StreamChatClient] to build the `x-stream-client` header // ignore: constant_identifier_names -const PACKAGE_VERSION = '1.5.2'; +const PACKAGE_VERSION = '1.5.3'; diff --git a/packages/stream_chat/pubspec.yaml b/packages/stream_chat/pubspec.yaml index b32bdf43f..c2d5f2db8 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: 1.5.2 +version: 1.5.3 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 7b78e11c8..efbdfccc3 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.3 + +- Updated `stream_chat_core` dependency + ## 1.5.2 - Fix accessibility text size overflows diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index 357bee09d..b31fffde1 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: 1.5.2 +version: 1.5.3 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_core/CHANGELOG.md b/packages/stream_chat_flutter_core/CHANGELOG.md index 0051b2c7f..68d01d52b 100644 --- a/packages/stream_chat_flutter_core/CHANGELOG.md +++ b/packages/stream_chat_flutter_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.2 + +* Update llc dependency + ## 1.5.1 * Improved test coverage to > 90% diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index 0a5844f77..f5d7eb920 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: 1.5.1 +version: 1.5.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_persistence/CHANGELOG.md b/packages/stream_chat_persistence/CHANGELOG.md index cf2fc54b4..e49719752 100644 --- a/packages/stream_chat_persistence/CHANGELOG.md +++ b/packages/stream_chat_persistence/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.2 + +* Fix sorting by last_updated + ## 1.5.1 * Improved test coverage to > 95% diff --git a/packages/stream_chat_persistence/pubspec.yaml b/packages/stream_chat_persistence/pubspec.yaml index 5423f0507..d53b4d7e9 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: 1.5.1 +version: 1.5.2 repository: https://github.com/GetStream/stream-chat-flutter issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues From d14e33b6976ec21455a8c2eddf5313b51e2000a7 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 30 Apr 2021 11:56:43 +0200 Subject: [PATCH 4/5] fix --- packages/stream_chat/lib/src/client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat/lib/src/client.dart b/packages/stream_chat/lib/src/client.dart index 21e90b212..fc6e122a0 100644 --- a/packages/stream_chat/lib/src/client.dart +++ b/packages/stream_chat/lib/src/client.dart @@ -546,7 +546,7 @@ class StreamChatClient { var event = await _chatPersistenceClient?.getConnectionInfo(); - await _ws.connect().then((e) async { + await _ws.connect().then((e) { _chatPersistenceClient?.updateConnectionInfo(e); event = e; resync(); From bcddda112be95cde26c85dda9ab363486a72da3b Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 3 May 2021 10:20:19 +0200 Subject: [PATCH 5/5] update deps --- packages/stream_chat_flutter/pubspec.yaml | 2 +- packages/stream_chat_flutter_core/pubspec.yaml | 2 +- packages/stream_chat_persistence/pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat_flutter/pubspec.yaml b/packages/stream_chat_flutter/pubspec.yaml index b31fffde1..d2cfce2ee 100644 --- a/packages/stream_chat_flutter/pubspec.yaml +++ b/packages/stream_chat_flutter/pubspec.yaml @@ -11,7 +11,7 @@ environment: dependencies: flutter: sdk: flutter - stream_chat_flutter_core: ^1.5.1 + stream_chat_flutter_core: ^1.5.2 photo_view: ^0.11.0 rxdart: ^0.25.0 scrollable_positioned_list: ^0.1.8 diff --git a/packages/stream_chat_flutter_core/pubspec.yaml b/packages/stream_chat_flutter_core/pubspec.yaml index f5d7eb920..9827c869e 100644 --- a/packages/stream_chat_flutter_core/pubspec.yaml +++ b/packages/stream_chat_flutter_core/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: sdk: flutter meta: ^1.2.4 rxdart: ^0.25.0 - stream_chat: ^1.5.1 + stream_chat: ^1.5.3 dev_dependencies: flutter_test: diff --git a/packages/stream_chat_persistence/pubspec.yaml b/packages/stream_chat_persistence/pubspec.yaml index d53b4d7e9..47e44a9e6 100644 --- a/packages/stream_chat_persistence/pubspec.yaml +++ b/packages/stream_chat_persistence/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: path: ^1.7.0 path_provider: ^1.6.27 sqlite3_flutter_libs: ^0.4.0+1 - stream_chat: ^1.5.1 + stream_chat: ^1.5.3 dev_dependencies: build_runner: ^1.11.0