@bobfrankston/rmfmail 1.0.702 → 1.0.703

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.
@@ -12,16 +12,48 @@
12
12
  var _callbacks = {};
13
13
  var _callbackId = 0;
14
14
  var _eventHandlers = [];
15
+ // 2026-05-13: trace WebView↔daemon pipe latency. The IPC has three
16
+ // stages: (1) WebView _ptick before postMessage, (2) Rust msger forwards
17
+ // to daemon stdin, (3) daemon logs `[ipc] ← <action> (<cbid>)`. Diffing
18
+ // (3) - (1) by cbid reveals whether a delay is in the WebView call
19
+ // queue or in the daemon's event loop. The tag IS visible in the daemon
20
+ // log via logClientEvent — `[client] ipc-send <action> cbid=N tEpoch=...`.
21
+ // High-res `performance.now()` is local to the WebView; we also include
22
+ // wall-clock so daemon-side timestamps align.
23
+ function _traceIpcSend(action, id) {
24
+ try {
25
+ var hr = (typeof performance !== "undefined" && performance.now) ? performance.now().toFixed(1) : "n/a";
26
+ var line = "ipc-send " + action + " cbid=" + id + " hr=" + hr + " wall=" + Date.now();
27
+ // Send via direct postMessage to avoid recursion — logClientEvent
28
+ // would re-enter callNode and create a circular trace.
29
+ if (window.ipc && window.ipc.postMessage) {
30
+ window.ipc.postMessage(JSON.stringify({
31
+ _action: "logClientEvent", _cbid: "trace-" + id, tag: line,
32
+ }));
33
+ }
34
+ } catch (e) { /* tracing must never break the call */ }
35
+ }
15
36
  function callNode(action, params) {
16
37
  var id = String(++_callbackId);
17
38
  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.
18
45
  var timer = setTimeout(function() {
19
46
  delete _callbacks[id];
20
47
  reject(new Error("mailxapi timeout: " + action));
21
- }, 120000);
48
+ }, 30000);
22
49
  _callbacks[id] = { resolve: resolve, reject: reject, timer: timer };
23
50
  var msg = Object.assign({ _action: action, _cbid: id }, params || {});
24
51
  if (window.ipc && window.ipc.postMessage) {
52
+ // Trace BEFORE the actual call so a slow daemon-receive shows
53
+ // up as ipc-send wall-clock + N seconds before the daemon
54
+ // logs `[ipc] ←`. Skip tracing on the trace event itself so
55
+ // we don't recurse.
56
+ if (action !== "logClientEvent") _traceIpcSend(action, id);
25
57
  window.ipc.postMessage(JSON.stringify(msg));
26
58
  } else {
27
59
  clearTimeout(timer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.0.702",
3
+ "version": "1.0.703",
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,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@bobfrankston/iflow-direct": "^0.1.44",
37
37
  "@bobfrankston/mailx-host": "^0.1.12",
38
- "@bobfrankston/mailx-imap": "^0.1.43",
38
+ "@bobfrankston/mailx-imap": "^0.1.44",
39
39
  "@bobfrankston/mailx-store-web": "^0.1.6",
40
40
  "@bobfrankston/mailx-sync": "^0.1.16",
41
41
  "@bobfrankston/miscinfo": "^1.0.10",
@@ -115,7 +115,7 @@
115
115
  "dependencies": {
116
116
  "@bobfrankston/iflow-direct": "^0.1.44",
117
117
  "@bobfrankston/mailx-host": "^0.1.12",
118
- "@bobfrankston/mailx-imap": "^0.1.43",
118
+ "@bobfrankston/mailx-imap": "^0.1.44",
119
119
  "@bobfrankston/mailx-store-web": "^0.1.6",
120
120
  "@bobfrankston/mailx-sync": "^0.1.16",
121
121
  "@bobfrankston/miscinfo": "^1.0.10",