fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues

This commit is contained in:
SL 2024-02-28 17:28:52 +08:00
parent e57a9a505c
commit 3900a39b66
5 changed files with 12 additions and 3 deletions

View File

@ -63,4 +63,6 @@
### 1.3.1
* fix: synchronization channel message multiple synchronization issue
### 1.3.2
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
### 1.3.3
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues

View File

@ -9,7 +9,7 @@
#### 安装
```
dependencies:
wukongimfluttersdk: ^1.3.2
wukongimfluttersdk: ^1.3.3
```
#### 引入
```dart

View File

@ -80,6 +80,7 @@ class HttpUtils {
int pullMode,
Function(WKSyncChannelMsg) back) async {
final dio = Dio();
print('同不消息');
final response = await dio.post('$apiURL/channel/messagesync', data: {
"login_uid": UserInfo.uid, // uid
"channel_id": channelID, // ID

View File

@ -308,6 +308,7 @@ class MessageDB {
}
var requestCount = 0;
var isMore = 1;
void getOrSyncHistoryMessages(
String channelId,
int channelType,
@ -359,7 +360,9 @@ class MessageDB {
} else {
oldestMsgSeq = oldestOrderSeq ~/ 1000;
}
if (oldestMsgSeq == 1) {
if (oldestMsgSeq == 1 || isMore == 0) {
isMore = 1;
requestCount = 0;
iGetOrSyncHistoryMsgBack(list);
return;
}
@ -460,15 +463,18 @@ class MessageDB {
if (syncChannelMsg != null &&
syncChannelMsg.messages != null &&
syncChannelMsg.messages!.isNotEmpty) {
isMore = syncChannelMsg.more;
getOrSyncHistoryMessages(channelId, channelType, oldestOrderSeq,
contain, pullMode, limit, iGetOrSyncHistoryMsgBack, syncBack);
} else {
requestCount = 0;
isMore = 1;
iGetOrSyncHistoryMsgBack(list);
}
});
} else {
requestCount = 0;
isMore = 1;
iGetOrSyncHistoryMsgBack(list);
}
}

View File

@ -15,7 +15,7 @@ description: wukong IM flutter sdk
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.3.2
version: 1.3.3
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
environment: