You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend outbox-listener-delivery-not-awaited coverage to inbox listeners and task handlers #1384
outbox-listener-delivery-not-awaited only inspects listeners registered through setOutboxListeners(). Inbox listeners and custom task handlers can drop the same delivery promises:
On Cloudflare Workers, an unawaited delivery from either callback can be canceled when the request or queue invocation ends. The existing rule already recognizes waitUntil() and treats it as handled, so ctx.waitUntil(ctx.sendActivity(...)) will pass once the 2.5 hook exists. The hook itself is tracked in #1383.
Proposed change
Generalize the listener visitor to recognize both setOutboxListeners() and setInboxListeners(), including their .on(), .onError() and .withIdempotency() chains. Add a visitor for defineTask(name, { handler }) and resolve the handler through the existing function-binding logic. Keep the current DELIVERY_METHOD_NAMES (sendActivity and forwardActivity) for this change. enqueueTask() can be a separate rule if it proves useful.
Add fixtures for inline and named handlers, a handler defined on createFederationBuilder(), and a ctx.waitUntil() call. Update the rule list in docs/manual/lint.md.
The current visitor is in packages/lint/src/lib/outbox-listener.ts, and the rule is in packages/lint/src/rules/outbox-listener-delivery-not-awaited.ts. #1057 added the original rule.
The existing rule name will no longer describe its full coverage. Keep the name for configuration compatibility and document the broader coverage, or rename it in a separate breaking change.
Why not a single generic rule
A generic rule for any callback that receives a Context would flag dispatchers that intentionally return a promise to the framework. It would also need receiver type information that the current ESTree walk does not have. Scoping the rule to listener and task registration keeps the false-positive rate low.
Activity
waitUntilhook for serverless request lifetimes #1383