@ai-matrx/messaging 0.10.4 → 0.10.5

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
@@ -1214,7 +1214,9 @@ function createMessagingEngine(options) {
1214
1214
  openChannels.get(message.conversationId)?.send(MESSAGING_EVENTS.message, message);
1215
1215
  }
1216
1216
  async function reloadInbox() {
1217
+ if (disposed) return;
1217
1218
  const page = await repository.listConversations({ limit: conversationPageSize });
1219
+ if (disposed) return;
1218
1220
  conversationCursor = page.nextCursor;
1219
1221
  store.setConversations(page.items, page.hasMore);
1220
1222
  }
@@ -1259,7 +1261,7 @@ function createMessagingEngine(options) {
1259
1261
  const message = projectMessage(row, identity.organizationId);
1260
1262
  const known = store.snapshot().conversations.some((item) => item.conversation.id === message.conversationId);
1261
1263
  if (!known) {
1262
- void reloadInbox();
1264
+ void reloadInbox().catch((error) => reportError(error, "inboxRefresh"));
1263
1265
  return;
1264
1266
  }
1265
1267
  store.ingest(message);
@@ -1275,7 +1277,7 @@ function createMessagingEngine(options) {
1275
1277
  filter: `user_id=eq.${identity.userId}`,
1276
1278
  rowId: (row) => typeof row["id"] === "string" ? row["id"] : void 0,
1277
1279
  onChange: () => {
1278
- void reloadInbox();
1280
+ void reloadInbox().catch((error) => reportError(error, "inboxRefresh"));
1279
1281
  }
1280
1282
  }
1281
1283
  ],