@onyx-p/imlib-web 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +5 -1
- package/index.umd.js +5 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
@@ -13402,13 +13402,13 @@ class WebSocketServer {
|
|
13402
13402
|
this.watcher = watcher;
|
13403
13403
|
}
|
13404
13404
|
async connect() {
|
13405
|
+
this.autoReconnect = true;
|
13405
13406
|
return new Promise(resolve => {
|
13406
13407
|
this.connectResolve = resolve;
|
13407
13408
|
this.open().then(authCode => {
|
13408
13409
|
resolve(authCode);
|
13409
13410
|
if (authCode === ErrorCode.SUCCESS) {
|
13410
13411
|
this.isConnected = true;
|
13411
|
-
this.autoReconnect = true;
|
13412
13412
|
this.onConnect();
|
13413
13413
|
} else {
|
13414
13414
|
this.onDisconnect(authCode === ErrorCode.TIMEOUT ? ConnectionStatus.NETWORK_UNAVAILABLE : ConnectionStatus.WEBSOCKET_UNAVAILABLE);
|
@@ -28704,7 +28704,9 @@ class IMClient extends EventEmitter {
|
|
28704
28704
|
});
|
28705
28705
|
}
|
28706
28706
|
async getPreviousHistoryMessages(conversation, timestamp, count = 20) {
|
28707
|
+
console.log('getPreviousHistoryMessages', conversation, timestamp, count);
|
28707
28708
|
const cachedResult = MessageCache.get().getPreviousMessages(conversation, timestamp ?? '0', count);
|
28709
|
+
console.log('getPreviousHistoryMessages cachedResult', cachedResult);
|
28708
28710
|
if (!timestamp && cachedResult.messages.length) {
|
28709
28711
|
ConversationManager$1.get().refreshLatestMessage(conversation, cachedResult.messages[cachedResult.messages.length - 1]);
|
28710
28712
|
}
|
@@ -28722,6 +28724,7 @@ class IMClient extends EventEmitter {
|
|
28722
28724
|
count: count - cachedResult.messages.length,
|
28723
28725
|
order: 0
|
28724
28726
|
});
|
28727
|
+
console.log('getPreviousHistoryMessages remotesResult', remotesResult);
|
28725
28728
|
if (remotesResult.code !== ErrorCode.SUCCESS) {
|
28726
28729
|
return remotesResult;
|
28727
28730
|
}
|
@@ -30105,6 +30108,7 @@ const getRemoteHistoryMessages = async (conversation, options) => {
|
|
30105
30108
|
assert('conversation', conversation, AssertRules.CONVERSATION, true);
|
30106
30109
|
const paramsStr = 'conversationType:' + conversation.conversationType + ',targetId:' + conversation.targetId;
|
30107
30110
|
logger.debug('get remote history message ->' + paramsStr);
|
30111
|
+
console.log('getRemoteHistoryMessages options', options);
|
30108
30112
|
if (isDef(options.timestamp)) {
|
30109
30113
|
options.timestamp = options.timestamp.toString();
|
30110
30114
|
}
|
package/index.umd.js
CHANGED
@@ -13408,13 +13408,13 @@
|
|
13408
13408
|
this.watcher = watcher;
|
13409
13409
|
}
|
13410
13410
|
async connect() {
|
13411
|
+
this.autoReconnect = true;
|
13411
13412
|
return new Promise(resolve => {
|
13412
13413
|
this.connectResolve = resolve;
|
13413
13414
|
this.open().then(authCode => {
|
13414
13415
|
resolve(authCode);
|
13415
13416
|
if (authCode === exports.ErrorCode.SUCCESS) {
|
13416
13417
|
this.isConnected = true;
|
13417
|
-
this.autoReconnect = true;
|
13418
13418
|
this.onConnect();
|
13419
13419
|
} else {
|
13420
13420
|
this.onDisconnect(authCode === exports.ErrorCode.TIMEOUT ? exports.ConnectionStatus.NETWORK_UNAVAILABLE : exports.ConnectionStatus.WEBSOCKET_UNAVAILABLE);
|
@@ -28710,7 +28710,9 @@
|
|
28710
28710
|
});
|
28711
28711
|
}
|
28712
28712
|
async getPreviousHistoryMessages(conversation, timestamp, count = 20) {
|
28713
|
+
console.log('getPreviousHistoryMessages', conversation, timestamp, count);
|
28713
28714
|
const cachedResult = MessageCache.get().getPreviousMessages(conversation, timestamp ?? '0', count);
|
28715
|
+
console.log('getPreviousHistoryMessages cachedResult', cachedResult);
|
28714
28716
|
if (!timestamp && cachedResult.messages.length) {
|
28715
28717
|
ConversationManager$1.get().refreshLatestMessage(conversation, cachedResult.messages[cachedResult.messages.length - 1]);
|
28716
28718
|
}
|
@@ -28728,6 +28730,7 @@
|
|
28728
28730
|
count: count - cachedResult.messages.length,
|
28729
28731
|
order: 0
|
28730
28732
|
});
|
28733
|
+
console.log('getPreviousHistoryMessages remotesResult', remotesResult);
|
28731
28734
|
if (remotesResult.code !== exports.ErrorCode.SUCCESS) {
|
28732
28735
|
return remotesResult;
|
28733
28736
|
}
|
@@ -30111,6 +30114,7 @@
|
|
30111
30114
|
assert('conversation', conversation, AssertRules.CONVERSATION, true);
|
30112
30115
|
const paramsStr = 'conversationType:' + conversation.conversationType + ',targetId:' + conversation.targetId;
|
30113
30116
|
logger.debug('get remote history message ->' + paramsStr);
|
30117
|
+
console.log('getRemoteHistoryMessages options', options);
|
30114
30118
|
if (isDef(options.timestamp)) {
|
30115
30119
|
options.timestamp = options.timestamp.toString();
|
30116
30120
|
}
|