@bobfrankston/rmfmail 1.2.235 → 1.2.237

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.
@@ -1437,6 +1437,7 @@ export class MailxService implements MailxApi {
1437
1437
  const sig = `${savedPath}:${stat.size}:${stat.mtimeMs}`;
1438
1438
  if (sig === lastSig) return;
1439
1439
  lastSig = sig;
1440
+ console.log(` [word-edit] file changed: ${name} (${stat.size} bytes) — converting`);
1440
1441
  try {
1441
1442
  let inner: string;
1442
1443
  if (isDocx) {
@@ -1461,6 +1462,15 @@ export class MailxService implements MailxApi {
1461
1462
  // vanished: "it acts as if it never happened" (Bob
1462
1463
  // 2026-08-06). Focus belongs at the END of the session
1463
1464
  // (wordEditClosed), not on every keystroke-triggered save.
1465
+ if (!inner.trim()) {
1466
+ // Never mirror an empty conversion into compose: that
1467
+ // replaces the user's message with nothing, which
1468
+ // reads as "it lost my work" rather than "the convert
1469
+ // failed".
1470
+ console.error(` [word-edit] conversion produced NO content for ${name} — not mirroring (message left as-is)`);
1471
+ return;
1472
+ }
1473
+ console.log(` [word-edit] save mirrored: ${name} → ${inner.length} chars of HTML for ${editId}`);
1464
1474
  this.imapManager.emit("wordEditUpdated", { editId, html: inner });
1465
1475
  } catch (e: any) {
1466
1476
  console.error(` [word-edit] read after save failed: ${e.message}`);
@@ -1542,6 +1552,15 @@ export class MailxService implements MailxApi {
1542
1552
  const bm = updatedHtml.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
1543
1553
  inner = bm ? bm[1] : updatedHtml;
1544
1554
  }
1555
+ if (!inner.trim()) {
1556
+ // Never mirror an empty conversion into compose: that
1557
+ // replaces the user's message with nothing, which
1558
+ // reads as "it lost my work" rather than "the convert
1559
+ // failed".
1560
+ console.error(` [word-edit] conversion produced NO content for ${name} — not mirroring (message left as-is)`);
1561
+ return;
1562
+ }
1563
+ console.log(` [word-edit] save mirrored: ${name} → ${inner.length} chars of HTML for ${editId}`);
1545
1564
  this.imapManager.emit("wordEditUpdated", { editId, html: inner });
1546
1565
  } catch (e: any) {
1547
1566
  console.error(` [word-edit fallback] read failed: ${e.message}`);