@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.js CHANGED
@@ -5089,9 +5089,30 @@ optAutomarkDelay?.addEventListener("change", () => {
5089
5089
  }
5090
5090
  });
5091
5091
  const isApp = typeof mailxapi !== "undefined" && mailxapi?.isApp;
5092
- // Wait for server ready signal, then fetch version
5093
- const versionPromise = getVersion();
5092
+ // Wait for server ready signal, then fetch version. getVersion is idempotent
5093
+ // and trivial; msger occasionally drops the startup IPC (see api-client note),
5094
+ // so retry with backoff rather than leaving "(??)" + a "service error" banner
5095
+ // up forever for a cosmetic version read (Bob 2026-06-02). A short per-action
5096
+ // timeout (mailxapi.js) makes each failed attempt give up in 5s.
5097
+ async function getVersionWithRetry(attempts = 5) {
5098
+ for (let i = 0; i < attempts; i++) {
5099
+ try {
5100
+ return await getVersion();
5101
+ }
5102
+ catch (e) {
5103
+ if (i === attempts - 1) {
5104
+ console.warn("getVersion failed after retries:", e);
5105
+ return {};
5106
+ }
5107
+ await new Promise(r => setTimeout(r, 1500));
5108
+ }
5109
+ }
5110
+ return {};
5111
+ }
5112
+ const versionPromise = getVersionWithRetry();
5094
5113
  versionPromise.then((d) => {
5114
+ if (!d || !d.version)
5115
+ return; // all retries dropped — leave the prior text, no scary banner
5095
5116
  const els = document.querySelectorAll(".app-version");
5096
5117
  const storage = d.storage || {};
5097
5118
  const storageLabel = storage.provider && storage.provider !== "local"