@decentnetwork/beagle 0.1.53 → 0.1.54

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.
@@ -1,4 +1,4 @@
1
- window.__DK_UI_VERSION="0.1.53";
1
+ window.__DK_UI_VERSION="0.1.54";
2
2
  const ICON_PATHS = {
3
3
  // ---- tab bar (the four must feel like one set) ----
4
4
  users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
@@ -612,27 +612,29 @@ export class EmbeddedHost {
612
612
  throw new Error(`Could not start the transfer, and the file is too large (${(data.length / 1024 / 1024).toFixed(1)} MB) ` +
613
613
  `for the inline fallback (limit ${(INLINE_MAX_BYTES / 1024 / 1024).toFixed(1)} MB).`);
614
614
  }
615
- // "sent" means the PEER CONFIRMED receipt — nothing less. Stamping it
616
- // when sendInlineFile resolved was the fake-sent of INBOX 2026-08-21:
617
- // bytes left the machine, the phone had nothing, the UI showed a
618
- // checkmark. The SDK's verdict now decides the chip.
619
- let delivery;
620
- try {
621
- delivery = await this.#node.sendInlineFile(userid, new Uint8Array(data), safe);
622
- }
623
- catch (e) {
624
- this.#messages.patchFile(userid, msg.id, { status: "failed" });
615
+ // "sent" means the PEER CONFIRMED receipt — nothing less (the fake-sent
616
+ // of INBOX 2026-08-21). And sends are NON-BLOCKING (the 2026-08-05
617
+ // rule): the delivery wait scales to 180s, and holding the request open
618
+ // that long froze the UI on an 8MB inline send. Return now; the SDK's
619
+ // verdict patches the chip through the event stream.
620
+ const bytes = new Uint8Array(data);
621
+ void (async () => {
622
+ let delivery;
623
+ try {
624
+ delivery = await this.#node.sendInlineFile(userid, bytes, safe);
625
+ }
626
+ catch (e) {
627
+ this.#messages.patchFile(userid, msg.id, { status: "failed" });
628
+ this.#events.emit("event", { type: "chat", userid, dir: "out" });
629
+ this.#logger.warn(`inline file "${safe}" to ${userid.slice(0, 8)} failed: ${e.message}`);
630
+ return;
631
+ }
632
+ const status = delivery === "acked" ? "sent" : delivery === "offline" ? "queued" : "failed";
633
+ this.#messages.patchFile(userid, msg.id, { status, sent: delivery === "acked" ? data.length : 0 });
625
634
  this.#events.emit("event", { type: "chat", userid, dir: "out" });
626
- throw e;
627
- }
628
- const status = delivery === "acked" ? "sent" : delivery === "offline" ? "queued" : "failed";
629
- this.#messages.patchFile(userid, msg.id, { status, sent: delivery === "acked" ? data.length : 0 });
630
- this.#events.emit("event", { type: "chat", userid, dir: "out" });
631
- if (delivery === "accepted") {
632
- throw new Error(`The peer never confirmed receiving "${safe}" — it likely did not arrive. ` +
633
- `Check that their app is open and try again.`);
634
- }
635
- return { inline: true, name: safe, size: data.length, delivery };
635
+ this.#logger.info(`inline file "${safe}" (${data.length}B) to ${userid.slice(0, 8)}: delivery=${delivery} → ${status}`);
636
+ })();
637
+ return { inline: true, name: safe, size: data.length, pending: true };
636
638
  }
637
639
  this.#activeSends.set(fileId, { peer: userid, msgId: msg.id });
638
640
  this.#meta.ensure(userid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@decentnetwork/chat-components": "^0.1.3",
29
- "@decentnetwork/lan": "^0.1.280",
29
+ "@decentnetwork/lan": "^0.1.281",
30
30
  "@decentnetwork/peer": "^0.1.141",
31
31
  "@decentnetwork/peer-webrtc": "^0.2.16",
32
32
  "js-yaml": "^4.1.0",