Repository navigation
Conversation
The immediate fan-out paths in FederationImpl.sendActivity() and InboxContextImpl.forwardActivityInternal() used Promise.all() alone. When one delivery rejected, the method returned while the remaining deliveries were still in flight, so Cloudflare Workers could terminate the isolate and cancel them. Put the fan-out loop and Promise.all() in a try block and drain the started promises with Promise.allSettled() in finally. The original error still propagates after the siblings settle, and a synchronous failure while preparing a later recipient no longer abandons earlier deliveries. Attach a no-op catch to each started promise so an early rejection cannot surface as an unhandled rejection while a later Collection-Synchronization header is being built. Add regression tests for the sendActivity() and forwardActivity() immediate paths and for a fan-out setup failure. Document the fix in the 2.0.36 changelog. fedify-dev#1380 Assisted-by: OpenCode:deepseek-flash Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-fable-5-1 Assisted-by: OpenCode:gemini-4-argon
|
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 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Summary
The immediate delivery paths in
sendActivity()andforwardActivity()usedPromise.all()alone. If one recipient failed, the method rejected while the other deliveries were still running. On Cloudflare Workers the isolate can be terminated at that point, which can cancel the remaining deliveries.This change makes both paths drain every delivery they have already started before propagating the original error.
Fixes #1380. Targets the
2.0-maintenancebranch.Changes
Promise.all()inFederationImpl.sendActivity()andInboxContextImpl.forwardActivityInternal()now sit inside atryblock, withPromise.allSettled()infinally. The original rejection still propagates after the siblings settle.catch()so an early rejection cannot surface as an unhandled rejection while a later recipient'sCollection-Synchronizationheader is being prepared.Benefits
Already-started sibling deliveries now settle before the caller receives the original error. Queue-backed delivery is unchanged, and the error that callers see is still the original one.