@bobfrankston/mailx 1.0.102 → 1.0.103
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 <
|
|
56
|
-
return; //
|
|
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
|
@@ -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
|
-
|
|
239
|
-
|
|
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,
|
|
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
|
-
|
|
61
|
-
|
|
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")) {
|
|
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