openmates 0.18.0-alpha.28 → 0.18.0-alpha.29
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/{chunk-4RPAJ4KP.js → chunk-DL2SX5XG.js} +24 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -11655,6 +11655,29 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
11655
11655
|
}).map((embed) => [embed.embed_id, embed])
|
|
11656
11656
|
);
|
|
11657
11657
|
if (finalized.size === 0) return;
|
|
11658
|
+
for (const parent of finalized.values()) {
|
|
11659
|
+
for (const childId of parent.embed_ids ?? []) {
|
|
11660
|
+
if (finalized.has(childId)) continue;
|
|
11661
|
+
const childResponse = params.ws.waitForMessage(
|
|
11662
|
+
"send_embed_data",
|
|
11663
|
+
(payload) => {
|
|
11664
|
+
const frame = payload;
|
|
11665
|
+
const nested = frame.payload ?? frame;
|
|
11666
|
+
return nested.embed_id === childId;
|
|
11667
|
+
}
|
|
11668
|
+
);
|
|
11669
|
+
await params.ws.sendAsync("request_embed", { embed_id: childId });
|
|
11670
|
+
const envelope = (await childResponse).payload;
|
|
11671
|
+
const child = envelope.payload ?? envelope;
|
|
11672
|
+
if (child.parent_embed_id !== parent.embed_id || !child.content || (child.status ?? "finished") !== "finished" || child.chat_id && child.chat_id !== params.chatId && child.chat_id !== computeSHA256(params.chatId)) {
|
|
11673
|
+
throw new Error(`Cannot persist referenced child embed ${childId}: original finished child data is unavailable.`);
|
|
11674
|
+
}
|
|
11675
|
+
if (child.message_id === computeSHA256(params.fallbackMessageId)) {
|
|
11676
|
+
child.message_id = params.fallbackMessageId;
|
|
11677
|
+
}
|
|
11678
|
+
finalized.set(childId, child);
|
|
11679
|
+
}
|
|
11680
|
+
}
|
|
11658
11681
|
const masterKey = this.getMasterKeyBytes();
|
|
11659
11682
|
const parentKeys = /* @__PURE__ */ new Map();
|
|
11660
11683
|
const processed = /* @__PURE__ */ new Set();
|
|
@@ -11757,8 +11780,8 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
11757
11780
|
);
|
|
11758
11781
|
await params.ws.sendAsync("store_embed_keys", { request_id: keysRequestId, keys });
|
|
11759
11782
|
await keysConfirmed;
|
|
11760
|
-
parentKeys.set(embed.embed_id, embedKey);
|
|
11761
11783
|
}
|
|
11784
|
+
parentKeys.set(embed.embed_id, embedKey);
|
|
11762
11785
|
if (Array.isArray(embed.version_history_rows)) {
|
|
11763
11786
|
for (const row of embed.version_history_rows) {
|
|
11764
11787
|
if (!row.embed_id || typeof row.version_number !== "number") continue;
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED