diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c8a2ff..3f0417f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ -## v4.2.12 (Apr 24, 2024) +## v4.2.13 (Apr 30, 2024) + +### Improvements +- Fixed the bugs regarding session update -### Breaking changes -- The return type for `getUndeliveredMembers()` was updated from `List` to `List?` +## v4.2.12 (Apr 24, 2024) ### Features - Updated dependency range for `connectivity_plus` package from `^5.0.1` to `>=5.0.1 <7.0.0` @@ -10,6 +12,9 @@ - Fixed `MessageCollection` regarding `resetMyHistory()` in `GroupChannel` - Fixed `removeFailedMessage()` and `removeAllFailedMessages()` in `MessageCollection` - Fixed the bugs regarding message change log, pending message removal, typing status and delivered status +- Added improvements on `getUndeliveredMembers()` method to prevent a potential problem + The return type for `getUndeliveredMembers()` was updated from `List` to `List?` + Please update this part of your code if you use `getUndeliveredMembers()` - Improved stability ## v4.2.11 (Apr 18, 2024) diff --git a/README.md b/README.md index 9aac8fc..8268a79 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o ```yaml dependencies: - sendbird_chat_sdk: ^4.2.12 + sendbird_chat_sdk: ^4.2.13 ``` - Run `flutter pub get` command in your project directory. diff --git a/lib/src/internal/main/chat/chat.dart b/lib/src/internal/main/chat/chat.dart index 14fd16a..5b22c6b 100644 --- a/lib/src/internal/main/chat/chat.dart +++ b/lib/src/internal/main/chat/chat.dart @@ -62,7 +62,7 @@ part 'chat_notifications.dart'; part 'chat_push.dart'; part 'chat_user.dart'; -const sdkVersion = '4.2.12'; +const sdkVersion = '4.2.13'; // Internal implementation for main class. Do not directly access this class. class Chat with WidgetsBindingObserver { diff --git a/lib/src/internal/main/chat_manager/command_manager.dart b/lib/src/internal/main/chat_manager/command_manager.dart index 0c9dded..dfefd42 100644 --- a/lib/src/internal/main/chat_manager/command_manager.dart +++ b/lib/src/internal/main/chat_manager/command_manager.dart @@ -377,8 +377,8 @@ class CommandManager { } else if (cmd.payload['expires_in'] != null ? cmd.payload['expires_in'] < 0 : false) { - // If session token is expired, then log out await _chat.connectionManager.disconnect(logout: true); + _chat.eventManager.notifySessionClosed(); } else { await _chat.sessionManager.updateSessionKey(); } @@ -707,7 +707,6 @@ class CommandManager { 'cmd: ${cmd.cmd}, errorMessage: ${cmd.errorMessage ?? ''}'); if (cmd.errorCode == SendbirdError.sessionKeyExpired) { - await _chat.connectionManager.disconnect(logout: true); await _chat.sessionManager.updateSessionKey(); } else if (cmd.errorCode == SendbirdError.accessTokenRevoked) { if (_chat.chatContext.loginCompleter != null && diff --git a/lib/src/internal/main/chat_manager/session_manager.dart b/lib/src/internal/main/chat_manager/session_manager.dart index 4a9ea36..f5ec32e 100644 --- a/lib/src/internal/main/chat_manager/session_manager.dart +++ b/lib/src/internal/main/chat_manager/session_manager.dart @@ -84,11 +84,11 @@ class SessionManager { setSessionKey(null); - // If websocket exists, ws request to update session key - if (_chat.connectionManager.isConnected()) { - await _chat.commandManager.updateSessionKey(); - return; - } + // If websocket exists, ws request to update session key => Check server error + // if (_chat.connectionManager.isConnected()) { + // await _chat.commandManager.updateSessionKey(); + // return; + // } final completer = Completer(); _updateSessionKeyCompleterList.add(completer); diff --git a/pubspec.yaml b/pubspec.yaml index c656d87..0f64e9a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sendbird_chat_sdk description: With Sendbird Chat for Flutter, you can easily build an in-app chat with all the essential messaging features. -version: 4.2.12 +version: 4.2.13 homepage: https://sendbird.com repository: https://github.com/sendbird/sendbird-chat-sdk-flutter documentation: https://sendbird.com/docs/chat/sdk/v4/flutter/getting-started/send-first-message