Repository navigation
Conversation
Automatic queue worker startup is best-effort: inbox handling and Context.sendActivity() call _startQueueInternal() without awaiting it. WorkersMessageQueue.listen() throws synchronously because Cloudflare Queues cannot be polled, so the async call produced an unhandled rejection. The synchronous throw also aborted the loop that collects listener promises, leaving listeners started before the throw unobserved and later queues never started. Normalize a synchronous throw from listen() into a rejected promise so every started listener reaches Promise.all, and route the three implicit call sites through a helper that logs the failure once instead of leaving the rejection unhandled. Explicit Federation.startQueue() keeps rejecting so deliberate worker startup failures stay visible. The failed worker is not retried, which the changelog and the manuallyStartQueue reference now state. Cloudflare Workers cannot start workers in the request process at all, so the example and the deployment and message queue documentation now set manuallyStartQueue to true. Fixes fedify-dev#1381 Assisted-by: OpenCode:deepseek-flash Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-fable-5-1
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Fixes #1381.
Why
manuallyStartQueuedefaults tofalse, so inbox handling andContext.sendActivity()start queue workers implicitly and drop the returned promise.WorkersMessageQueue.listen()throws synchronously because Cloudflare Queues cannot be polled. The throw also aborted the loop that collected listener promises, so listeners started before it were never awaited and later queues never started.How
#listenQueue()converts synchronous throws to rejected promises, so all started listener promises reachPromise.all()and a failing queue no longer blocks the rest. The three automatic call sites now use_startQueueAutomatically(), which logs one warning per federation instance instead of leaking the rejection.Federation.startQueue()keeps rejecting. A failed worker is not retried, because its started flag is set beforelisten()is called. The changelog and themanuallyStartQueuereference say so.Tests
Regression tests in packages/fedify/src/federation/middleware.test.ts cover the
fetch()path, a rejection that arrives after startup, the explicitstartQueue()rejection, a failing queue next to healthy ones, and the outbox and fanout send paths. They pass on Deno, Node.js, and Bun, andmise run checkand the docs build pass.The Cloudflare Workers example and the deployment, message queue, and federation pages now set
manuallyStartQueue: true.