@bobfrankston/rmfmail 1.2.113 → 1.2.115
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/TODO.md +5 -5
- package/bin/mailx.js +72 -3
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +62 -3
- package/client/android-bootstrap.bundle.js +60 -3
- package/client/android-bootstrap.bundle.js.map +2 -2
- package/client/app.bundle.js +46 -0
- package/client/app.bundle.js.map +2 -2
- package/client/app.js +66 -0
- package/client/app.js.map +1 -1
- package/client/app.ts +60 -0
- package/client/compose/compose.bundle.js +7 -2
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/compose/compose.js +16 -5
- package/client/compose/compose.js.map +1 -1
- package/client/compose/compose.ts +13 -5
- package/package.json +5 -5
- package/packages/mailx-imap/index.d.ts +4 -1
- package/packages/mailx-imap/index.d.ts.map +1 -1
- package/packages/mailx-imap/index.js +59 -5
- package/packages/mailx-imap/index.js.map +1 -1
- package/packages/mailx-imap/index.ts +55 -5
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-store-web/android-bootstrap.js +48 -3
- package/packages/mailx-store-web/android-bootstrap.js.map +1 -1
- package/packages/mailx-store-web/android-bootstrap.ts +47 -4
- package/packages/mailx-store-web/package.json +1 -1
- package/packages/mailx-store-web/web-service.d.ts +21 -0
- package/packages/mailx-store-web/web-service.d.ts.map +1 -1
- package/packages/mailx-store-web/web-service.js +11 -0
- package/packages/mailx-store-web/web-service.js.map +1 -1
- package/packages/mailx-store-web/web-service.ts +11 -0
- package/packages/mailx-types/mailx-api.d.ts +22 -0
- package/packages/mailx-types/mailx-api.d.ts.map +1 -1
- package/packages/mailx-types/mailx-api.ts +7 -0
- package/packages/mailx-types/package.json +1 -1
package/client/app.js
CHANGED
|
@@ -657,6 +657,69 @@ function scheduleSyncedStamp() {
|
|
|
657
657
|
}
|
|
658
658
|
}, SYNC_SETTLE_MS);
|
|
659
659
|
}
|
|
660
|
+
// C121: connect-phase ticker. The daemon emits connectProgress per IMAP
|
|
661
|
+
// connection attempt (socket → handshake → done/failed). While any attempt
|
|
662
|
+
// has been in flight longer than CONNECT_SHOW_AFTER_MS, the status bar shows
|
|
663
|
+
// "Connecting to <host> (<phase> <purpose>, 3.2s)" with a live elapsed
|
|
664
|
+
// counter — so a stuck DNS/TLS/greeting/LOGIN is distinguishable at a glance
|
|
665
|
+
// instead of an opaque frozen "Syncing…". Healthy sub-second connects never
|
|
666
|
+
// surface (the delay gate kills the flicker).
|
|
667
|
+
const activeConnects = new Map();
|
|
668
|
+
const CONNECT_SHOW_AFTER_MS = 1500;
|
|
669
|
+
let connectTickTimer = null;
|
|
670
|
+
function handleConnectProgress(event) {
|
|
671
|
+
const key = `${event.accountId}|${event.purpose}`;
|
|
672
|
+
if (event.phase === "done" || event.phase === "failed") {
|
|
673
|
+
activeConnects.delete(key);
|
|
674
|
+
if (activeConnects.size === 0 && connectTickTimer) {
|
|
675
|
+
clearInterval(connectTickTimer);
|
|
676
|
+
connectTickTimer = null;
|
|
677
|
+
// Leave the bar to the normal sync handlers; stamp settle so a
|
|
678
|
+
// lingering "Connecting…" flips to Synced when things go quiet.
|
|
679
|
+
scheduleSyncedStamp();
|
|
680
|
+
}
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
const existing = activeConnects.get(key);
|
|
684
|
+
if (existing) {
|
|
685
|
+
existing.phase = event.phase;
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
activeConnects.set(key, {
|
|
689
|
+
host: event.host || event.accountId,
|
|
690
|
+
purpose: event.purpose || "",
|
|
691
|
+
phase: event.phase,
|
|
692
|
+
startedAt: Date.now() - (event.elapsedMs || 0),
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
if (!connectTickTimer)
|
|
696
|
+
connectTickTimer = setInterval(renderConnectTick, 100);
|
|
697
|
+
}
|
|
698
|
+
function renderConnectTick() {
|
|
699
|
+
const el = document.getElementById("status-sync");
|
|
700
|
+
if (!el || activeConnects.size === 0)
|
|
701
|
+
return;
|
|
702
|
+
// Staleness guard: if a done/failed event got lost (daemon restart,
|
|
703
|
+
// dropped IPC line) an entry would tick forever — expire at 10 min,
|
|
704
|
+
// well past any transport timeout.
|
|
705
|
+
const now = Date.now();
|
|
706
|
+
for (const [k, c] of activeConnects) {
|
|
707
|
+
if (now - c.startedAt > 600_000)
|
|
708
|
+
activeConnects.delete(k);
|
|
709
|
+
}
|
|
710
|
+
// Show the LONGEST-waiting attempt — that's the one worth staring at.
|
|
711
|
+
let worst = null;
|
|
712
|
+
for (const c of activeConnects.values()) {
|
|
713
|
+
if (!worst || c.startedAt < worst.startedAt)
|
|
714
|
+
worst = c;
|
|
715
|
+
}
|
|
716
|
+
if (!worst)
|
|
717
|
+
return;
|
|
718
|
+
const elapsed = Date.now() - worst.startedAt;
|
|
719
|
+
if (elapsed < CONNECT_SHOW_AFTER_MS)
|
|
720
|
+
return;
|
|
721
|
+
el.textContent = `Connecting to ${worst.host} (${worst.phase}${worst.purpose ? " " + worst.purpose : ""}, ${(elapsed / 1000).toFixed(1)}s)`;
|
|
722
|
+
}
|
|
660
723
|
// ── Auto two-line when message list is narrow ──
|
|
661
724
|
const messageList = document.getElementById("message-list");
|
|
662
725
|
if (messageList) {
|
|
@@ -3148,6 +3211,9 @@ onWsEvent((event) => {
|
|
|
3148
3211
|
startupStatus.textContent = "Loading accounts...";
|
|
3149
3212
|
// Don't refresh folder tree on connect — it's already loaded by initFolderTree
|
|
3150
3213
|
break;
|
|
3214
|
+
case "connectProgress":
|
|
3215
|
+
handleConnectProgress(event);
|
|
3216
|
+
break;
|
|
3151
3217
|
case "syncProgress": {
|
|
3152
3218
|
// Aggregate folders phases ("folders:<path>" when starting a folder,
|
|
3153
3219
|
// "folders-done" between folders) print as a proportion so the user
|