From bd94bc0094f224c97adec0b48a02cafea92b9a57 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sat, 14 Nov 2026 16:05:57 +0000 Subject: [PATCH 1/2] fix(mail): Resend sends directly unless EMAIL_QUEUE_REDIS_URL is set Since 0.52 every Resend send went through the email queue and failed closed without Redis, and no queue worker is deployed, so every Resend newsletter and test copy failed with 'Email queue requires EMAIL_QUEUE_REDIS_URL'. Resend now joins the queue only when EMAIL_QUEUE_REDIS_URL is set; otherwise it sends through the Resend API directly, as before. Gmail still fails closed. Co-Authored-By: Claude Opus 5.5 --- packages/core/src/core/mail/index.ts | 16 +++++++++++----- packages/core/test/mail-send.test.ts | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/packages/core/src/core/mail/index.ts b/packages/core/src/core/mail/index.ts index c4017cb..e505e0d 100644 --- a/packages/core/src/core/mail/index.ts +++ b/packages/core/src/core/mail/index.ts @@ -126,9 +126,13 @@ export function emailQueueStartupProblems(env: Record { const url = process.env.EMAIL_QUEUE_REDIS_URL ?? (mustQueue ? process.env.REDIS_URL : undefined) ?? ""; - if (!url) return { ok: false, retryable: true, status: 429, error: "Email queue requires EMAIL_QUEUE_REDIS_URL (Redis); Gmail/Resend direct sending is disabled." }; + if (!url) return { ok: false, retryable: true, status: 429, error: "Email queue requires EMAIL_QUEUE_REDIS_URL (Redis); Gmail direct sending is disabled." }; const problems = emailQueueStartupProblems({ ...process.env, EMAIL_QUEUE_REDIS_URL: url }); if (problems.length) { // Same shape as "queue unavailable": a newsletter stops at the first one instead of burning the list. diff --git a/packages/core/test/mail-send.test.ts b/packages/core/test/mail-send.test.ts index cb744d3..1948488 100644 --- a/packages/core/test/mail-send.test.ts +++ b/packages/core/test/mail-send.test.ts @@ -205,6 +205,27 @@ test("non-Google SMTP stays direct without the queue env and joins the queue whe } }, 20_000); +test("Resend sends directly without EMAIL_QUEUE_REDIS_URL and joins the queue when it is set", async () => { + const saved = { url: process.env.EMAIL_QUEUE_REDIS_URL, key: process.env.EMAIL_QUEUE_ENCRYPTION_KEY }; + try { + delete process.env.EMAIL_QUEUE_REDIS_URL; + delete process.env.EMAIL_QUEUE_ENCRYPTION_KEY; + saveMailProvider({ id: "rs", type: "resend", from: "News " }, "re_supersecret"); + const direct = resolveSender("rs"); + expect("google" in direct).toBe(false); // the plain Resend provider, no queue wrapper + expect(direct.type).toBe("resend"); + process.env.EMAIL_QUEUE_REDIS_URL = "redis://127.0.0.1:1"; + const queued = resolveSender("rs"); + expect("google" in queued).toBe(true); + const result = await queued.send({ to: "a@example.net", subject: "s", text: "t" }); + expect(result.ok).toBe(false); + expect(result.error).toContain("no direct send attempted"); + } finally { + if (saved.url === undefined) delete process.env.EMAIL_QUEUE_REDIS_URL; else process.env.EMAIL_QUEUE_REDIS_URL = saved.url; + if (saved.key === undefined) delete process.env.EMAIL_QUEUE_ENCRYPTION_KEY; else process.env.EMAIL_QUEUE_ENCRYPTION_KEY = saved.key; + } +}, 20_000); + test("a queue without EMAIL_QUEUE_ENCRYPTION_KEY is reported at startup", () => { expect(emailQueueStartupProblems({})).toEqual([]); expect(emailQueueStartupProblems({ EMAIL_QUEUE_REDIS_URL: "redis://x" }).join(" ")).toContain("EMAIL_QUEUE_ENCRYPTION_KEY is not set"); From 2a3335b7cfc23e11186a8a7be54ae5332b49aeec Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sat, 14 Nov 2026 16:06:42 +0000 Subject: [PATCH 2/2] chore: v0.56.1 Co-Authored-By: Claude Opus 5.5 --- apps/cli/package.json | 2 +- bun.lock | 6 +++--- packages/core/package.json | 2 +- packages/core/src/version.ts | 2 +- packages/mcp/package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index d53b011..4ad3b10 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@profullstack/myna", - "version": "0.56.0", + "version": "0.56.1", "description": "A terminal social media manager. Log in, compose, schedule and post to every network from one TUI.", "license": "MIT", "type": "module", diff --git a/bun.lock b/bun.lock index fc125fe..32689ff 100644 --- a/bun.lock +++ b/bun.lock @@ -25,7 +25,7 @@ }, "apps/cli": { "name": "@profullstack/myna", - "version": "0.56.0", + "version": "0.56.1", "bin": { "myna": "./bin/myna.mjs", }, @@ -60,7 +60,7 @@ }, "packages/core": { "name": "@profullstack/myna-core", - "version": "0.56.0", + "version": "0.56.1", "dependencies": { "@anthropic-ai/sdk": "^0.123.0", "@profullstack/ai-providers": "^0.3.1", @@ -84,7 +84,7 @@ }, "packages/mcp": { "name": "@profullstack/myna-mcp", - "version": "0.56.0", + "version": "0.56.1", "bin": { "myna-mcp": "./src/server.ts", }, diff --git a/packages/core/package.json b/packages/core/package.json index e91fee5..d3d4ab9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@profullstack/myna-core", - "version": "0.56.0", + "version": "0.56.1", "description": "Network adapters, credential vault, scheduling and the AI writer behind myna.", "license": "MIT", "type": "module", diff --git a/packages/core/src/version.ts b/packages/core/src/version.ts index 4af144b..5db4b04 100644 --- a/packages/core/src/version.ts +++ b/packages/core/src/version.ts @@ -6,4 +6,4 @@ * binary reporting the wrong version, and nothing would fail. A test asserts * this matches the package.json it is published under. */ -export const VERSION = "0.56.0"; +export const VERSION = "0.56.1"; diff --git a/packages/mcp/package.json b/packages/mcp/package.json index 688dfce..4bc2836 100644 --- a/packages/mcp/package.json +++ b/packages/mcp/package.json @@ -1,6 +1,6 @@ { "name": "@profullstack/myna-mcp", - "version": "0.56.0", + "version": "0.56.1", "description": "MCP server for myna. Lets an agent post, schedule and read across every connected social account.", "license": "MIT", "type": "module",