@bobfrankston/mailx 1.0.102 → 1.0.104

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.
@@ -52,8 +52,8 @@ function requestSuggestion(editor, context) {
52
52
  abortController = null;
53
53
  }
54
54
  const bodyText = editor.getText();
55
- if (!bodyText || bodyText.trim().length < 10)
56
- return; // too short to suggest
55
+ if (!bodyText || bodyText.trim().length < 3)
56
+ return; // need at least a few characters
57
57
  abortController = new AbortController();
58
58
  const signal = abortController.signal;
59
59
  autocomplete({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.102",
3
+ "version": "1.0.104",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -235,10 +235,15 @@ export class ImapManager extends EventEmitter {
235
235
  console.log(` [auth] ${account.id}: token valid`);
236
236
  }
237
237
  catch (e) {
238
- console.error(` [auth] ${account.id}: ${imapError(e)}`);
239
- if (!this.accountErrorShown.has(account.id)) {
238
+ const errMsg = imapError(e);
239
+ console.error(` [auth] ${account.id}: ${errMsg}`);
240
+ const isTransient = /timeout|ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENETUNREACH/i.test(errMsg);
241
+ if (isTransient) {
242
+ console.log(` [transient] ${account.id}: ${errMsg} — will retry on first sync`);
243
+ }
244
+ else if (!this.accountErrorShown.has(account.id)) {
240
245
  this.accountErrorShown.add(account.id);
241
- this.emit("accountError", account.id, imapError(e), "Authentication may have expired", true);
246
+ this.emit("accountError", account.id, errMsg, "Authentication may have expired", true);
242
247
  }
243
248
  }
244
249
  }
@@ -57,13 +57,15 @@ if (settings.accounts.length === 0) {
57
57
  const dbDir = getConfigDir();
58
58
  const db = new MailxDB(dbDir);
59
59
  const imapManager = new ImapManager(db);
60
- if (process.argv.includes("--legacy-imap") || process.argv.includes("-legacy-imap")) {
61
- console.log(" Using legacy IMAP client (imapflow)");
62
- }
63
- else {
60
+ // Native IMAP client has connection leak — logout() doesn't reliably close sockets.
61
+ // Use legacy imapflow by default until fixed. --native-imap to test.
62
+ if (process.argv.includes("--native-imap") || process.argv.includes("-native-imap") || process.env.MAILX_NATIVE_IMAP) {
64
63
  imapManager.useNativeClient = true;
65
64
  console.log(" Using native IMAP client (transport-agnostic)");
66
65
  }
66
+ else {
67
+ console.log(" Using legacy IMAP client (imapflow)");
68
+ }
67
69
  // ── Express App ──
68
70
  const app = express();
69
71
  app.use(express.json({ limit: "Infinity" }));
package/rebuild.cmd ADDED
@@ -0,0 +1,7 @@
1
+ setlocal
2
+ set MAILX_NATIVE_IMAP=1
3
+ cld
4
+ call npmglobalize
5
+ call killmail.cmd
6
+ launch.ps1
7
+ endlocal