@bobfrankston/iflow 1.0.41 → 1.0.43

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.
@@ -141,18 +141,16 @@ export class NativeImapClient {
141
141
  this.capabilities.add(c.toUpperCase());
142
142
  }
143
143
  async logout() {
144
+ // Send LOGOUT but don't wait — just close the transport immediately.
145
+ // The server will clean up the session when the socket closes.
144
146
  try {
145
147
  if (this._connected) {
146
148
  const tag = proto.nextTag();
147
- // Timeout the LOGOUT command — don't let it hang forever
148
- await Promise.race([
149
- this.sendCommand(tag, proto.logoutCommand(tag)),
150
- new Promise((_, reject) => setTimeout(() => reject(new Error("LOGOUT timeout")), 5000))
151
- ]);
149
+ this.transport.write(proto.logoutCommand(tag)).catch(() => { });
152
150
  }
153
151
  }
154
- catch { /* ignore — always close transport below */ }
155
- this.pendingCommand = null; // clear any hanging promise
152
+ catch { /* ignore */ }
153
+ this.pendingCommand = null;
156
154
  this.transport.close();
157
155
  this._connected = false;
158
156
  }
@@ -530,9 +528,13 @@ export class NativeImapClient {
530
528
  this.pendingCommand.responses.push(resp);
531
529
  continue;
532
530
  }
533
- // Continuation — resolve if waiting
531
+ // Continuation response
534
532
  if (resp.tag === "+") {
535
- // Handled by waitForContinuation
533
+ // If not in IDLE and no one is waiting for continuation (APPEND),
534
+ // this is likely an AUTHENTICATE challenge — send empty line to cancel
535
+ if (!this.idleTag && this.pendingCommand) {
536
+ this.transport.write("\r\n").catch(() => { });
537
+ }
536
538
  continue;
537
539
  }
538
540
  // Tagged response — command complete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "IMAP client wrapper library",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",