@bobfrankston/rmfmail 1.1.211 → 1.1.213

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/client/app.ts CHANGED
@@ -4750,9 +4750,24 @@ optAutomarkDelay?.addEventListener("change", () => {
4750
4750
  declare const mailxapi: { isApp: boolean; platform: string; ensureServer: () => Promise<boolean>; getVersion: () => Promise<any> } | undefined;
4751
4751
  const isApp = typeof mailxapi !== "undefined" && mailxapi?.isApp;
4752
4752
 
4753
- // Wait for server ready signal, then fetch version
4754
- const versionPromise = getVersion();
4753
+ // Wait for server ready signal, then fetch version. getVersion is idempotent
4754
+ // and trivial; msger occasionally drops the startup IPC (see api-client note),
4755
+ // so retry with backoff rather than leaving "(??)" + a "service error" banner
4756
+ // up forever for a cosmetic version read (Bob 2026-06-02). A short per-action
4757
+ // timeout (mailxapi.js) makes each failed attempt give up in 5s.
4758
+ async function getVersionWithRetry(attempts = 5): Promise<any> {
4759
+ for (let i = 0; i < attempts; i++) {
4760
+ try { return await getVersion(); }
4761
+ catch (e) {
4762
+ if (i === attempts - 1) { console.warn("getVersion failed after retries:", e); return {}; }
4763
+ await new Promise(r => setTimeout(r, 1500));
4764
+ }
4765
+ }
4766
+ return {};
4767
+ }
4768
+ const versionPromise = getVersionWithRetry();
4755
4769
  versionPromise.then((d: any) => {
4770
+ if (!d || !d.version) return; // all retries dropped — leave the prior text, no scary banner
4756
4771
  const els = document.querySelectorAll<HTMLElement>(".app-version");
4757
4772
  const storage = d.storage || {};
4758
4773
  const storageLabel = storage.provider && storage.provider !== "local"
@@ -53,6 +53,12 @@
53
53
  // turned a slow-but-fine search into "mailxapi timeout:
54
54
  // searchMessages". Local search stays fast and well under any limit.
55
55
  searchMessages: 120000,
56
+ // getVersion reads package.json — instant. The only way it "times out"
57
+ // is msger silently dropping the IPC (see api-client note). A short
58
+ // ceiling makes the client detect the drop fast and retry, instead of
59
+ // staring at "(??)" + a scary "service error" banner for 30s (Bob
60
+ // 2026-06-02). The app.ts version display retries on this rejection.
61
+ getVersion: 5000,
56
62
  };
57
63
  function callNode(action, params) {
58
64
  var id = String(++_callbackId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.1.211",
3
+ "version": "1.1.213",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",