@agentvault/agentvault 0.14.19 → 0.14.21

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/dist/index.js CHANGED
@@ -49243,6 +49243,9 @@ ${messageText}`;
49243
49243
  if (msgData.message_id) {
49244
49244
  this._sendAck(msgData.message_id);
49245
49245
  }
49246
+ if (msgData.created_at && this._persisted) {
49247
+ this._persisted.lastMessageTimestamp = msgData.created_at;
49248
+ }
49246
49249
  await this._persistState();
49247
49250
  const metadata = {
49248
49251
  messageId: msgData.message_id ?? "",
@@ -49469,14 +49472,30 @@ ${messageText}`;
49469
49472
  if (this._syncMessageIds.has(msg.id)) continue;
49470
49473
  this._syncMessageIds.add(msg.id);
49471
49474
  if (this._persisted?.rooms) {
49472
- let isRoomConv = false;
49475
+ let roomId;
49473
49476
  for (const room of Object.values(this._persisted.rooms)) {
49474
49477
  if (room.conversationIds?.includes(msg.conversation_id)) {
49475
- isRoomConv = true;
49478
+ roomId = room.roomId;
49476
49479
  break;
49477
49480
  }
49478
49481
  }
49479
- if (isRoomConv) {
49482
+ if (roomId) {
49483
+ try {
49484
+ await this._handleRoomMessage({
49485
+ room_id: roomId,
49486
+ sender_device_id: msg.sender_device_id,
49487
+ conversation_id: msg.conversation_id,
49488
+ header_blob: msg.header_blob,
49489
+ ciphertext: msg.ciphertext,
49490
+ message_id: msg.id,
49491
+ created_at: msg.created_at
49492
+ });
49493
+ } catch (roomErr) {
49494
+ console.warn(
49495
+ `[SecureChannel] Sync room message failed for ${msg.conversation_id.slice(0, 8)}...:`,
49496
+ roomErr
49497
+ );
49498
+ }
49480
49499
  this._persisted.lastMessageTimestamp = msg.created_at;
49481
49500
  since = msg.created_at;
49482
49501
  continue;