Skip to content

Commit 890d341

Browse files
Merge pull request #109 from sendbird/v4.2.14
Add 4.2.14.
2 parents 406c9ab + 793a544 commit 890d341

File tree

18 files changed

+116
-59
lines changed

18 files changed

+116
-59
lines changed

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v4.2.14 (May 16, 2024)
2+
3+
### Improvements
4+
- Fixed the exceptions regarding url encoding for api
5+
- Fixed the bug that profile image is not updated on web
6+
- Fixed the bugs regarding event, exception and cache
7+
- Modified the event order regarding failed messages in message collection
8+
- Improved stability
9+
110
## v4.2.13 (Apr 30, 2024)
211

312
### Improvements
@@ -12,9 +21,9 @@
1221
- Fixed `MessageCollection` regarding `resetMyHistory()` in `GroupChannel`
1322
- Fixed `removeFailedMessage()` and `removeAllFailedMessages()` in `MessageCollection`
1423
- Fixed the bugs regarding message change log, pending message removal, typing status and delivered status
15-
- Added improvements on `getUndeliveredMembers()` method to prevent a potential problem
16-
The return type for `getUndeliveredMembers()` was updated from `List<Member>` to `List<Member>?`
17-
Please update this part of your code if you use `getUndeliveredMembers()`
24+
- Added improvements on `getUndeliveredMembers()` method to prevent a potential problem.
25+
The return type for `getUndeliveredMembers()` was updated from `List<Member>` to `List<Member>?`.
26+
Please update this part of your code if you use `getUndeliveredMembers()`.
1827
- Improved stability
1928

2029
## v4.2.11 (Apr 18, 2024)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o
5050

5151
```yaml
5252
dependencies:
53-
sendbird_chat_sdk: ^4.2.13
53+
sendbird_chat_sdk: ^4.2.14
5454
```
5555
5656
- Run `flutter pub get` command in your project directory.

lib/src/internal/db/schema/channel/meta/c_channel_info.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ class CChannelInfo {
1515

1616
CChannelInfo();
1717

18-
factory CChannelInfo.fromChangeLogInfo(ChannelInfo info) {
18+
factory CChannelInfo.fromChannelInfo(ChannelInfo info) {
1919
return CChannelInfo()
2020
..lastChannelToken = info.lastChannelToken
2121
..isChannelBackSyncCompleted = info.isChannelBackSyncCompleted;
2222
}
2323

24-
Future<ChannelInfo> toChangeLogInfo(Chat chat, Isar isar) async {
24+
Future<ChannelInfo> toChannelInfo(Chat chat, Isar isar) async {
2525
return ChannelInfo(
2626
lastChannelToken: lastChannelToken,
2727
isChannelBackSyncCompleted: isChannelBackSyncCompleted,
@@ -30,20 +30,20 @@ class CChannelInfo {
3030

3131
static Future<CChannelInfo> upsert(
3232
Chat chat, Isar isar, ChannelInfo info) async {
33-
final cChangeLog = CChannelInfo.fromChangeLogInfo(info);
33+
final cChannelInfo = CChannelInfo.fromChannelInfo(info);
3434

3535
// ChangeLogInfo
3636
await chat.dbManager.write(() async {
3737
await isar.cChannelInfos.clear();
38-
await isar.cChannelInfos.put(cChangeLog);
38+
await isar.cChannelInfos.put(cChannelInfo);
3939
}, force: true);
4040

41-
return cChangeLog;
41+
return cChannelInfo;
4242
}
4343

4444
static Future<ChannelInfo?> get(Chat chat, Isar isar) async {
45-
final cChangeLog = await isar.cChannelInfos.where().findFirst();
46-
return await cChangeLog?.toChangeLogInfo(chat, isar);
45+
final cChannelInfo = await isar.cChannelInfos.where().findFirst();
46+
return await cChannelInfo?.toChannelInfo(chat, isar);
4747
}
4848

4949
static Future<void> delete(Chat chat, Isar isar) async {

lib/src/internal/main/chat/chat.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ part 'chat_notifications.dart';
6262
part 'chat_push.dart';
6363
part 'chat_user.dart';
6464

65-
const sdkVersion = '4.2.13';
65+
const sdkVersion = '4.2.14';
6666

6767
// Internal implementation for main class. Do not directly access this class.
6868
class Chat with WidgetsBindingObserver {

lib/src/internal/main/chat_manager/collection_manager/group_channel_collection_manager.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extension GroupChannelCollectionManager on CollectionManager {
113113
(updatedChannels != null && updatedChannels.isNotEmpty) ||
114114
(deletedChannelUrls != null && deletedChannelUrls.isNotEmpty)) {
115115
for (final channelCollection in groupChannelCollections) {
116-
sendEventsToGroupChannelCollection(
116+
await sendEventsToGroupChannelCollection(
117117
channelCollection: channelCollection,
118118
eventSource: eventSource,
119119
addedChannels: addedChannels,
@@ -136,7 +136,7 @@ extension GroupChannelCollectionManager on CollectionManager {
136136
//------------------------------//
137137
// Send events to groupChannel collection
138138
//------------------------------//
139-
void sendEventsToGroupChannelCollection({
139+
Future<void> sendEventsToGroupChannelCollection({
140140
required GroupChannelCollection channelCollection,
141141
required CollectionEventSource eventSource,
142142
List<GroupChannel>? addedChannels,

lib/src/internal/main/chat_manager/collection_manager/message_collection_manager.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ extension MessageCollectionManager on CollectionManager {
498498
if (updatedChannel.channelUrl ==
499499
messageCollection.baseChannel.channelUrl) {
500500
if (!messageCollection.isDisposed) {
501+
messageCollection.baseChannel = updatedChannel;
502+
501503
if (messageCollection.baseHandler is MessageCollectionHandler &&
502504
updatedChannel is GroupChannel) {
503505
(messageCollection.baseHandler as MessageCollectionHandler)

lib/src/internal/main/chat_manager/command_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ class CommandManager {
950950
}
951951
} else {
952952
final groupChannel =
953-
GroupChannel.getChannelFromCache(event.channelUrl);
953+
await GroupChannel.getChannelFromCache(event.channelUrl);
954954

955955
if (groupChannel != null) {
956956
if (groupChannel.isSuper) {

lib/src/internal/main/utils/string_utils.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ String getFileExtension(String fileName) {
1919
String getUrlEncodedUserId(Chat chat, String? userId) {
2020
return Uri.encodeComponent(userId ?? chat.chatContext.currentUserId ?? '');
2121
}
22+
23+
List<String> getUrlEncodedUserIds(Chat chat, List<String> userIds) {
24+
return userIds.map((userId) => Uri.encodeComponent(userId)).toList();
25+
}

lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_update_request.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2023 Sendbird, Inc. All rights reserved.
22

3+
import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart';
34
import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/cache_service.dart';
45
import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/channel/channel_cache_extensions.dart';
5-
import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart';
66
import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart';
77
import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart';
88
import 'package:sendbird_chat_sdk/src/public/core/channel/base_channel/base_channel.dart';

lib/src/internal/network/http/http_client/request/channel/group_channel/moderation/channel_user_unban_request.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart';
44
import 'package:sendbird_chat_sdk/src/internal/main/extensions/extensions.dart';
5+
import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart';
56
import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart';
67
import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart';
78
import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart';
@@ -16,6 +17,7 @@ class ChannelUserUnbanRequest extends ApiRequest {
1617
required String channelUrl,
1718
required String targetId,
1819
}) : super(chat: chat) {
19-
url = '${channelType.urlString}/$channelUrl/ban/$targetId';
20+
url =
21+
'${channelType.urlString}/$channelUrl/ban/${getUrlEncodedUserId(chat, targetId)}';
2022
}
2123
}

0 commit comments

Comments
 (0)