@ai-matrx/messaging 0.15.1 → 0.15.3
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/CHANGELOG.md +13 -0
- package/dist/index.cjs +16 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +16 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +16 -3
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1766,10 +1766,23 @@ function createMessagingRepository(options) {
|
|
|
1766
1766
|
});
|
|
1767
1767
|
return found;
|
|
1768
1768
|
}
|
|
1769
|
+
const conversationOrganizations = /* @__PURE__ */ new Map();
|
|
1769
1770
|
async function organizationOfExisting(conversationId) {
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1771
|
+
const known = conversationOrganizations.get(conversationId);
|
|
1772
|
+
if (known !== void 0) return known;
|
|
1773
|
+
const operation = "organizationOfExisting";
|
|
1774
|
+
const { data, error } = await withSessionRetry(
|
|
1775
|
+
operation,
|
|
1776
|
+
async () => db().from(TABLES.conversations).select("organization_id").eq("id", conversationId).single()
|
|
1777
|
+
);
|
|
1778
|
+
if (error !== null) throw normalizeMessagingError(error, operation);
|
|
1779
|
+
const own = data?.["organization_id"];
|
|
1780
|
+
if (typeof own !== "string" || own.length === 0) {
|
|
1781
|
+
throw invalidResponse(operation, `conversation ${conversationId} has no organization`);
|
|
1782
|
+
}
|
|
1783
|
+
const organization = own;
|
|
1784
|
+
conversationOrganizations.set(conversationId, organization);
|
|
1785
|
+
return organization;
|
|
1773
1786
|
}
|
|
1774
1787
|
const repository = {
|
|
1775
1788
|
organizationId: org,
|