diff --git a/CHANGELOG.md b/CHANGELOG.md index 1baeece..f3a0160 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ +## v4.2.7 (Mar 21, 2024) + +### Improvements +- Updated dependency range for http, uuid and logger packages +- Fixed the exception regarding encrypt package + ## v4.2.6 (Mar 20, 2024) ### Improvements -- Fix the bug regarding reaction payload parsing +- Fixed the bug regarding reaction payload parsing ## v4.2.5 (Mar 12, 2024) diff --git a/README.md b/README.md index 291154a..b577204 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o ```yaml dependencies: - sendbird_chat_sdk: ^4.2.6 + sendbird_chat_sdk: ^4.2.7 ``` - 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 a6c7534..1bd5d23 100644 --- a/lib/src/internal/main/chat/chat.dart +++ b/lib/src/internal/main/chat/chat.dart @@ -60,7 +60,7 @@ part 'chat_notifications.dart'; part 'chat_push.dart'; part 'chat_user.dart'; -const sdkVersion = '4.2.6'; +const sdkVersion = '4.2.7'; // Internal implementation for main class. Do not directly access this class. class Chat with WidgetsBindingObserver { diff --git a/lib/src/internal/main/chat_manager/session_manager.dart b/lib/src/internal/main/chat_manager/session_manager.dart index bb44131..4a9ea36 100644 --- a/lib/src/internal/main/chat_manager/session_manager.dart +++ b/lib/src/internal/main/chat_manager/session_manager.dart @@ -169,11 +169,14 @@ class SessionManager { ..addAll(randomStringData); } - final base64UserId = base64.encode(userId24Data); + String base64UserId = base64.encode(userId24Data); + if (base64UserId.length > 16) { + base64UserId = base64UserId.substring(0, 16); + } prefs.setString(_userIdKeyPath, base64UserId); final key = Key.fromUtf8(base64UserId); - final iv = IV.fromLength(16); + final iv = IV.fromUtf8(base64UserId); final encrypter = Encrypter(AES(key)); final encryptedData = encrypter.encrypt(sessionKey, iv: iv); prefs.setString(_sessionKeyPath, encryptedData.base64); @@ -188,7 +191,7 @@ class SessionManager { } final key = Key.fromUtf8(encryptedUserId); - final iv = IV.fromLength(16); + final iv = IV.fromUtf8(encryptedUserId); final encrypter = Encrypter(AES(key)); final encryptedSessionKey = prefs.getString(_sessionKeyPath); diff --git a/lib/src/public/core/channel/group_channel/group_channel.dart b/lib/src/public/core/channel/group_channel/group_channel.dart index dec328d..eadb84f 100644 --- a/lib/src/public/core/channel/group_channel/group_channel.dart +++ b/lib/src/public/core/channel/group_channel/group_channel.dart @@ -185,7 +185,6 @@ class GroupChannel extends BaseChannel { @JsonKey(name: 'ts_message_offset') int? messageOffsetTimestamp; - /// The message survival seconds in this channel. int messageSurvivalSeconds; /// The pinned message ids of the channel. diff --git a/lib/src/public/core/message/base_message.dart b/lib/src/public/core/message/base_message.dart index d5324a7..830f85b 100644 --- a/lib/src/public/core/message/base_message.dart +++ b/lib/src/public/core/message/base_message.dart @@ -79,7 +79,6 @@ class BaseMessage extends RootMessage { /// The thread info of the message. ThreadInfo? threadInfo; - /// The message's survival seconds. @JsonKey(defaultValue: -1) int? messageSurvivalSeconds; diff --git a/pubspec.yaml b/pubspec.yaml index 6dcfb2a..dc7c7e8 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.6 +version: 4.2.7 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 @@ -18,12 +18,12 @@ dependencies: flutter: sdk: flutter collection: ^1.17.0 - uuid: ^3.0.7 + uuid: '>=3.0.7 <5.0.0' json_annotation: ^4.8.1 encrypt: ^5.0.1 shared_preferences: ^2.2.2 - http: ^0.13.6 - logger: ^1.4.0 + http: '>=0.13.6 <2.0.0' + logger: '>=1.4.0 <3.0.0' mime: ^1.0.4 connectivity_plus: ^5.0.1 http_parser: ^4.0.2