@bobfrankston/rmfmail 1.1.80 → 1.1.81
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/.commitmsg +20 -12
- package/client/app.bundle.js +10 -9
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +8 -0
- package/client/app.js.map +1 -1
- package/client/app.ts +8 -0
- package/client/components/message-viewer.js +18 -15
- package/client/components/message-viewer.js.map +1 -1
- package/client/components/message-viewer.ts +17 -13
- package/client/lib/mailxapi.js +6 -0
- package/npmchanges.md +15 -0
- package/package.json +3 -3
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-78668 → node_modules.npmglobalize-stash-76204}/.package-lock.json +0 -0
package/.commitmsg
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
Fix
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
Fix spurious attachment-open error + blocking alert that stalled sync
|
|
2
|
+
|
|
3
|
+
Three faults behind "failed to open" appearing after the file had
|
|
4
|
+
actually opened in Acrobat:
|
|
5
|
+
|
|
6
|
+
1. The openAttachment IPC call used the default 30s ceiling. A cold
|
|
7
|
+
parse worker (14-25s) plus a 1.7 MB PDF blew past it, so the client
|
|
8
|
+
rejected even though the service succeeded. getAttachment/
|
|
9
|
+
openAttachment now get a 120s ceiling in mailxapi.js.
|
|
10
|
+
|
|
11
|
+
2. On that spurious rejection the viewer ran the browser-only blob
|
|
12
|
+
fallback, whose atob() threw "string not correctly encoded". The
|
|
13
|
+
fallback now runs ONLY when openAttachment returns undefined (real
|
|
14
|
+
browser / --server mode); a genuine IPC failure is reported, not
|
|
15
|
+
retried via blob.
|
|
16
|
+
|
|
17
|
+
3. The failure was shown with window.alert() — a modal that freezes the
|
|
18
|
+
WebView event loop, stalling IPC event delivery so sync looked
|
|
19
|
+
stopped. Replaced with a non-blocking banner via a mailx-alert
|
|
20
|
+
CustomEvent handled by app.ts showAlert().
|
package/client/app.bundle.js
CHANGED
|
@@ -1672,13 +1672,9 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
|
|
|
1672
1672
|
await bridge.openAttachment(att.filename, data2.contentType, data2.content);
|
|
1673
1673
|
return;
|
|
1674
1674
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
return;
|
|
1679
|
-
} catch (svcErr) {
|
|
1680
|
-
console.warn(`[attachment] service open failed, falling back to blob: ${svcErr?.message || svcErr}`);
|
|
1681
|
-
}
|
|
1675
|
+
const res = await openAttachment(accountId, uid, i, msg.folderId);
|
|
1676
|
+
if (res)
|
|
1677
|
+
return;
|
|
1682
1678
|
const data = await getAttachment(accountId, uid, i, msg.folderId);
|
|
1683
1679
|
const bytes = Uint8Array.from(atob(data.content), (c) => c.charCodeAt(0));
|
|
1684
1680
|
const blob = new Blob([bytes], { type: data.contentType });
|
|
@@ -1694,8 +1690,9 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
|
|
|
1694
1690
|
URL.revokeObjectURL(url);
|
|
1695
1691
|
}, 5e3);
|
|
1696
1692
|
} catch (err) {
|
|
1697
|
-
|
|
1698
|
-
|
|
1693
|
+
const m = `Couldn't open "${att.filename}": ${err?.message || err}`;
|
|
1694
|
+
console.error(m);
|
|
1695
|
+
window.dispatchEvent(new CustomEvent("mailx-alert", { detail: { message: m, key: "attachment-open" } }));
|
|
1699
1696
|
}
|
|
1700
1697
|
});
|
|
1701
1698
|
chip.draggable = true;
|
|
@@ -6681,6 +6678,10 @@ function showAlert(message, key, opts) {
|
|
|
6681
6678
|
}
|
|
6682
6679
|
}
|
|
6683
6680
|
}
|
|
6681
|
+
window.addEventListener("mailx-alert", (e) => {
|
|
6682
|
+
const d = e.detail || {};
|
|
6683
|
+
if (d.message) showAlert(String(d.message), d.key);
|
|
6684
|
+
});
|
|
6684
6685
|
function hideAlert() {
|
|
6685
6686
|
if (alertBanner) {
|
|
6686
6687
|
const key = alertBanner.dataset.key;
|