diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index f8a5bee7b..a74b920e4 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -1,3 +1,9 @@ +## 3.5.1 + +🐞 Fixed +- `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 ✅ Added diff --git a/packages/stream_chat/lib/src/client/channel.dart b/packages/stream_chat/lib/src/client/channel.dart index 0493c0d7e..f2effe04b 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); } diff --git a/packages/stream_chat/lib/src/ws/websocket.dart b/packages/stream_chat/lib/src/ws/websocket.dart index 82c7d7c16..888ba08bf 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; } @@ -216,7 +220,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); + } }, ); } diff --git a/packages/stream_chat/lib/version.dart b/packages/stream_chat/lib/version.dart index 0ae6a20a0..8d0584a04 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 6e6893c17..2e195f6b6 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 8aa64cd92..2e81c800a 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.5.1 + +🐞 Fixed + +- 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 🐞 Fixed diff --git a/packages/stream_chat_flutter/example/android/app/build.gradle b/packages/stream_chat_flutter/example/android/app/build.gradle index fbd6268ef..3974f9496 100644 --- a/packages/stream_chat_flutter/example/android/app/build.gradle +++ b/packages/stream_chat_flutter/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -41,7 +41,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/packages/stream_chat_flutter/example/android/app/src/main/AndroidManifest.xml b/packages/stream_chat_flutter/example/android/app/src/main/AndroidManifest.xml index 42c5fa1ea..5e2f5ec01 100644 --- a/packages/stream_chat_flutter/example/android/app/src/main/AndroidManifest.xml +++ b/packages/stream_chat_flutter/example/android/app/src/main/AndroidManifest.xml @@ -16,6 +16,7 @@ android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" + android:exported="true" android:windowSoftInputMode="adjustResize">