@bobfrankston/iflow-direct 0.1.46 → 0.1.47

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.
Files changed (2) hide show
  1. package/imap-native.js +14 -0
  2. package/package.json +1 -1
package/imap-native.js CHANGED
@@ -923,9 +923,23 @@ export class NativeImapClient {
923
923
  let myReject;
924
924
  const myPromise = new Promise((res, rej) => { myResolve = res; myReject = rej; });
925
925
  this.commandChain = myPromise.catch(() => { });
926
+ // Phase timing — multi-session "62 s INBOX stall" hunt. The stall
927
+ // produces NO `>` log (sendCommandCore never runs), so it lives in
928
+ // one of the two awaits below. Logging only slow phases (>1 s, Bob's
929
+ // "synchronous shouldn't span" threshold lifted to network scale)
930
+ // pins which one without spamming the normal fast path.
931
+ const __cmdName = command.split(/[\s\r]/)[0] || command.slice(0, 12);
932
+ const __p0 = Date.now();
926
933
  await prev;
934
+ const __prevMs = Date.now() - __p0;
935
+ if (__prevMs > 1000)
936
+ console.warn(` [imap] cmd-chain wait ${__prevMs}ms before ${__cmdName} (predecessor held the connection)`);
927
937
  try {
938
+ const __p1 = Date.now();
928
939
  const idleState = await this.suspendIdleForCommand();
940
+ const __idleMs = Date.now() - __p1;
941
+ if (__idleMs > 1000)
942
+ console.warn(` [imap] IDLE-suspend wait ${__idleMs}ms before ${__cmdName}`);
929
943
  try {
930
944
  const out = await this.sendCommandCore(tag, command, onUntagged);
931
945
  myResolve(out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",