@bobfrankston/rmfmail 1.1.3 → 1.1.4

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/index.html CHANGED
@@ -615,10 +615,13 @@
615
615
  }
616
616
  }
617
617
  </script>
618
- <!-- Early error handlers ship problems to logit when running in
619
- a context that can reach the network (Android shell). msger
620
- desktop has its own console + log-file path, so these are a
621
- no-op there (fetch may fail silently that's fine). -->
618
+ <!-- Early error handlers + console capture synchronous so the
619
+ capture is in place BEFORE any module script runs. Previously the
620
+ capture was injected by the C# bridge on Android, which races the
621
+ JS bootstrap: on Bob's device the bridge log arrived at 12.7s,
622
+ meaning every console.log before that point was silently dropped.
623
+ Installing the capture here means initAndroid's "Initializing..."
624
+ and every step after is visible from t=0, on every platform. -->
622
625
  <script>
623
626
  function _mailxLogit(prefix, msg) {
624
627
  // silent=true keeps verbose logs out of jserv's UI; the file
@@ -626,6 +629,22 @@
626
629
  // logged, just not noisy.
627
630
  try { fetch("https://rmf39.aaz.lt/logit/" + encodeURIComponent(prefix + ": " + msg) + "?log=mailx-android&silent=true").catch(function(){}); } catch (e) {}
628
631
  }
632
+ (function() {
633
+ var origLog = console.log, origErr = console.error, origWarn = console.warn;
634
+ function capture(level, args) {
635
+ try {
636
+ var msg = Array.prototype.map.call(args, function(a) {
637
+ return typeof a === "object" ? JSON.stringify(a) : String(a);
638
+ }).join(" ");
639
+ var el = document.getElementById("startup-status");
640
+ if (el) el.textContent = level + ": " + msg.substring(0, 200);
641
+ _mailxLogit("JS/" + level, msg.substring(0, 500));
642
+ } catch (e) {}
643
+ }
644
+ console.log = function() { origLog.apply(console, arguments); capture("LOG", arguments); };
645
+ console.error = function() { origErr.apply(console, arguments); capture("ERR", arguments); };
646
+ console.warn = function() { origWarn.apply(console, arguments); capture("WARN", arguments); };
647
+ })();
629
648
  window.addEventListener("unhandledrejection", function(e) {
630
649
  var msg = (e.reason && e.reason.message) || e.reason || "unknown";
631
650
  var el = document.getElementById("startup-status");
@@ -33,19 +33,23 @@
33
33
  }
34
34
  } catch (e) { /* tracing must never break the call */ }
35
35
  }
36
+ // Per-action IPC timeout ceiling. Default 30s — covers local DB reads,
37
+ // parses, and writes that complete in well under 1s on a healthy
38
+ // daemon (anything longer = event loop wedged, retry faster). Actions
39
+ // that legitimately wait on a network round-trip get a higher ceiling.
40
+ // aiTransform: cloud-AI inference (Claude/OpenAI/Ollama) takes 5-30s
41
+ // for a paragraph of text, 30-60s for a long message — 90s ceiling
42
+ // catches genuine wedges without falsely failing real waits.
43
+ var ACTION_TIMEOUT_MS = {
44
+ aiTransform: 90000,
45
+ };
36
46
  function callNode(action, params) {
37
47
  var id = String(++_callbackId);
38
48
  return new Promise(function(resolve, reject) {
39
- // 2026-05-13: dropped from 120s to 30s. With parseSerial
40
- // priority queue + lazy folder sync, every legit IPC completes
41
- // in well under 1s. A wait past 30s is the daemon's event loop
42
- // genuinely wedged — surfacing the failure faster lets the
43
- // retry path kick in 4× sooner and keeps the user from staring
44
- // at "Loading body…" for a full 2 minutes.
45
49
  var timer = setTimeout(function() {
46
50
  delete _callbacks[id];
47
51
  reject(new Error("mailxapi timeout: " + action));
48
- }, 30000);
52
+ }, ACTION_TIMEOUT_MS[action] || 30000);
49
53
  _callbacks[id] = { resolve: resolve, reject: reject, timer: timer };
50
54
  var msg = Object.assign({ _action: action, _cbid: id }, params || {});
51
55
  if (window.ipc && window.ipc.postMessage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -35,12 +35,12 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@bobfrankston/iflow-direct": "^0.1.44",
38
- "@bobfrankston/mailx-host": "^0.1.12",
39
- "@bobfrankston/mailx-imap": "^0.1.44",
40
- "@bobfrankston/mailx-store-web": "^0.1.7",
38
+ "@bobfrankston/mailx-host": "^0.1.13",
39
+ "@bobfrankston/mailx-imap": "^0.1.45",
40
+ "@bobfrankston/mailx-store-web": "^0.1.8",
41
41
  "@bobfrankston/mailx-sync": "^0.1.16",
42
42
  "@bobfrankston/miscinfo": "^1.0.10",
43
- "@bobfrankston/msger": "^0.1.379",
43
+ "@bobfrankston/msger": "^0.1.381",
44
44
  "@bobfrankston/node-tcp-transport": "^0.1.8",
45
45
  "@bobfrankston/oauthsupport": "^1.0.26",
46
46
  "@bobfrankston/rmf-tiny": "^0.1.11",
@@ -115,12 +115,12 @@
115
115
  ".transformedSnapshot": {
116
116
  "dependencies": {
117
117
  "@bobfrankston/iflow-direct": "^0.1.44",
118
- "@bobfrankston/mailx-host": "^0.1.12",
119
- "@bobfrankston/mailx-imap": "^0.1.44",
120
- "@bobfrankston/mailx-store-web": "^0.1.7",
118
+ "@bobfrankston/mailx-host": "^0.1.13",
119
+ "@bobfrankston/mailx-imap": "^0.1.45",
120
+ "@bobfrankston/mailx-store-web": "^0.1.8",
121
121
  "@bobfrankston/mailx-sync": "^0.1.16",
122
122
  "@bobfrankston/miscinfo": "^1.0.10",
123
- "@bobfrankston/msger": "^0.1.379",
123
+ "@bobfrankston/msger": "^0.1.381",
124
124
  "@bobfrankston/node-tcp-transport": "^0.1.8",
125
125
  "@bobfrankston/oauthsupport": "^1.0.26",
126
126
  "@bobfrankston/rmf-tiny": "^0.1.11",