@onyx-p/imlib-web 1.6.4 → 1.6.6

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 CHANGED
@@ -9514,6 +9514,7 @@ function createWebSocket(url, protocols) {
9514
9514
  },
9515
9515
  onMessage(callback) {
9516
9516
  ws.onmessage = evt => {
9517
+ console.log('onMessage=========', evt.data);
9517
9518
  callback(evt.data);
9518
9519
  };
9519
9520
  },
@@ -13570,7 +13571,7 @@ class WebSocketServer {
13570
13571
  resolve(networkResponse.body);
13571
13572
  this.responseCallbacks.delete(messageSeq);
13572
13573
  } else {
13573
- logger.info(`websocket recv -> cmd: 0x${networkResponse.cmdId.toString(16)}, messageSeq: ${messageSeq}`);
13574
+ logger.info(`websocket recv -> cmd: 0x${networkResponse.cmdId.toString(16)}`);
13574
13575
  this.watcher?.message(networkResponse.cmdId, networkResponse.body);
13575
13576
  }
13576
13577
  }
@@ -17472,7 +17473,7 @@ const GetNewSettingDialogListResp = $root$1.GetNewSettingDialogListResp = (() =>
17472
17473
  };
17473
17474
  return GetNewSettingDialogListResp;
17474
17475
  })();
17475
- $root$1.NewMessageNotificationResp = (() => {
17476
+ const NewMessageNotificationResp = $root$1.NewMessageNotificationResp = (() => {
17476
17477
  /**
17477
17478
  * Properties of a NewMessageNotificationResp.
17478
17479
  * @exports INewMessageNotificationResp
@@ -19835,14 +19836,14 @@ class MessageLoader {
19835
19836
  this.cancelRetryTask();
19836
19837
  this.pullingMsg = true;
19837
19838
  const inboxTime = this.letterbox.getInboxOffset();
19838
- this.pullOfflineFinished || logger.info(`pullMsg -> time: ${inboxTime}`);
19839
+ logger.info(`pullMsg -> time: ${inboxTime}`);
19839
19840
  this.latestSyncTimestamp = Date.now();
19840
19841
  const {
19841
19842
  code,
19842
19843
  data
19843
19844
  } = await getNewMessages(inboxTime, 60);
19844
19845
  if (code !== ErrorCode.SUCCESS) {
19845
- this.pullOfflineFinished || logger.warn('pullMsg failed -> code:', code);
19846
+ logger.warn('pullMsg failed -> code:', code);
19846
19847
  this.pullingMsg = false;
19847
19848
  this.try2RePullMsg();
19848
19849
  return;
@@ -19889,7 +19890,7 @@ class MessageLoader {
19889
19890
  this.serverMsgSeqno = seqno;
19890
19891
  }
19891
19892
  const isFinished = this.serverMsgSeqno.lessThanOrEqual(offset);
19892
- this.pullOfflineFinished || logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19893
+ logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19893
19894
  this.letterbox?.setInboxOffset(offset);
19894
19895
  this.pullingMsg = false;
19895
19896
  if (isFinished && !this.pullOfflineFinished) {
@@ -20124,6 +20125,8 @@ class LibLoader {
20124
20125
  messageListener(cmdId, body) {
20125
20126
  if (cmdId === CmdIds$1.NewMessagePush) {
20126
20127
  console.log('messageListener: new message push');
20128
+ const newMsgNotiResp = NewMessageNotificationResp.decode(body);
20129
+ this.messageLoader?.syncMsg(newMsgNotiResp.seqno);
20127
20130
  } else if (cmdId === CmdIds$1.DialogChangedPush) {
20128
20131
  ConversationManager$1.get().syncConversationStatus();
20129
20132
  } else {
package/index.umd.js CHANGED
@@ -9520,6 +9520,7 @@
9520
9520
  },
9521
9521
  onMessage(callback) {
9522
9522
  ws.onmessage = evt => {
9523
+ console.log('onMessage=========', evt.data);
9523
9524
  callback(evt.data);
9524
9525
  };
9525
9526
  },
@@ -13576,7 +13577,7 @@
13576
13577
  resolve(networkResponse.body);
13577
13578
  this.responseCallbacks.delete(messageSeq);
13578
13579
  } else {
13579
- logger.info(`websocket recv -> cmd: 0x${networkResponse.cmdId.toString(16)}, messageSeq: ${messageSeq}`);
13580
+ logger.info(`websocket recv -> cmd: 0x${networkResponse.cmdId.toString(16)}`);
13580
13581
  this.watcher?.message(networkResponse.cmdId, networkResponse.body);
13581
13582
  }
13582
13583
  }
@@ -17478,7 +17479,7 @@
17478
17479
  };
17479
17480
  return GetNewSettingDialogListResp;
17480
17481
  })();
17481
- $root$1.NewMessageNotificationResp = (() => {
17482
+ const NewMessageNotificationResp = $root$1.NewMessageNotificationResp = (() => {
17482
17483
  /**
17483
17484
  * Properties of a NewMessageNotificationResp.
17484
17485
  * @exports INewMessageNotificationResp
@@ -19841,14 +19842,14 @@
19841
19842
  this.cancelRetryTask();
19842
19843
  this.pullingMsg = true;
19843
19844
  const inboxTime = this.letterbox.getInboxOffset();
19844
- this.pullOfflineFinished || logger.info(`pullMsg -> time: ${inboxTime}`);
19845
+ logger.info(`pullMsg -> time: ${inboxTime}`);
19845
19846
  this.latestSyncTimestamp = Date.now();
19846
19847
  const {
19847
19848
  code,
19848
19849
  data
19849
19850
  } = await getNewMessages(inboxTime, 60);
19850
19851
  if (code !== exports.ErrorCode.SUCCESS) {
19851
- this.pullOfflineFinished || logger.warn('pullMsg failed -> code:', code);
19852
+ logger.warn('pullMsg failed -> code:', code);
19852
19853
  this.pullingMsg = false;
19853
19854
  this.try2RePullMsg();
19854
19855
  return;
@@ -19895,7 +19896,7 @@
19895
19896
  this.serverMsgSeqno = seqno;
19896
19897
  }
19897
19898
  const isFinished = this.serverMsgSeqno.lessThanOrEqual(offset);
19898
- this.pullOfflineFinished || logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19899
+ logger.info(`pullMsg success -> syncTime: ${offset}, finished: ${isFinished}`);
19899
19900
  this.letterbox?.setInboxOffset(offset);
19900
19901
  this.pullingMsg = false;
19901
19902
  if (isFinished && !this.pullOfflineFinished) {
@@ -20130,6 +20131,8 @@
20130
20131
  messageListener(cmdId, body) {
20131
20132
  if (cmdId === CmdIds$1.NewMessagePush) {
20132
20133
  console.log('messageListener: new message push');
20134
+ const newMsgNotiResp = NewMessageNotificationResp.decode(body);
20135
+ this.messageLoader?.syncMsg(newMsgNotiResp.seqno);
20133
20136
  } else if (cmdId === CmdIds$1.DialogChangedPush) {
20134
20137
  ConversationManager$1.get().syncConversationStatus();
20135
20138
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",