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
The existing outbox listener rule in packages/lint/src/rules/outbox-listener-delivery-required.ts catches a useful class of delivery mistakes, but it currently decides success by finding a ctx.sendActivity() or ctx.forwardActivity()-style call somewhere in the listener source. That keeps the first implementation simple, but it can treat unreachable or unrelated calls as proof that every posted activity is delivered.
This matters because a local outbox handler that accepts a post without actually delivering it creates a confusing ActivityPub failure: the object exists locally, but followers never receive it.
Current code
The rule already handles direct calls, aliases, destructuring, bracket notation, template literals, and named listener callbacks. The related tests live in packages/lint/src/tests/outbox-listener-delivery-required.test.ts.
The next step is not to rewrite the rule from scratch. It is to make the delivery check understand enough control flow to avoid obvious false negatives.
Scope
Please update the rule so that it does not count delivery calls that are clearly outside the listener delivery path. Good starting cases are:
ctx.sendActivity() inside a nested helper function that is declared but never called.
ctx.forwardActivity() behind if (false) or after an unconditional return.
A delivery call that only exists in a callback passed to an unrelated API, such as array.map(() => ctx.sendActivity(...)), when the callback is not awaited or returned.Withdrawn. This was written on the assumption that a callback whose result is dropped never runs. It does: map() invokes its callback for every element, so the delivery call executes and the promise is simply discarded. That is worth catching, but it is a different defect from a delivery call that never runs, and it needs a message that says so. It is now tracked in Add a lint rule for outbox delivery that is never awaited #1057.
The implementation can be conservative. When the rule cannot show that a delivery call fails to run, it should stay quiet: a missed warning is safer than a warning on a listener that delivers.
Non-goals
Do not try to build a full TypeScript control-flow analyzer. Do not require type information. This rule should keep working in both the Deno lint plugin and the ESLint plugin surfaces.
Suggested checks
Add focused tests in packages/lint/src/tests/outbox-listener-delivery-required.test.ts. Existing positive cases should keep passing, especially the alias and named-listener cases.
Why
The existing outbox listener rule in packages/lint/src/rules/outbox-listener-delivery-required.ts catches a useful class of delivery mistakes, but it currently decides success by finding a
ctx.sendActivity()orctx.forwardActivity()-style call somewhere in the listener source. That keeps the first implementation simple, but it can treat unreachable or unrelated calls as proof that every posted activity is delivered.This matters because a local outbox handler that accepts a post without actually delivering it creates a confusing ActivityPub failure: the object exists locally, but followers never receive it.
Current code
The rule already handles direct calls, aliases, destructuring, bracket notation, template literals, and named listener callbacks. The related tests live in packages/lint/src/tests/outbox-listener-delivery-required.test.ts.
The next step is not to rewrite the rule from scratch. It is to make the delivery check understand enough control flow to avoid obvious false negatives.
Scope
Please update the rule so that it does not count delivery calls that are clearly outside the listener delivery path. Good starting cases are:
ctx.sendActivity()inside a nested helper function that is declared but never called.ctx.forwardActivity()behindif (false)or after an unconditionalreturn.A delivery call that only exists in a callback passed to an unrelated API, such asWithdrawn. This was written on the assumption that a callback whose result is dropped never runs. It does:array.map(() => ctx.sendActivity(...)), when the callback is not awaited or returned.map()invokes its callback for every element, so the delivery call executes and the promise is simply discarded. That is worth catching, but it is a different defect from a delivery call that never runs, and it needs a message that says so. It is now tracked in Add a lint rule for outbox delivery that is never awaited #1057.The implementation can be conservative. When the rule cannot show that a delivery call fails to run, it should stay quiet: a missed warning is safer than a warning on a listener that delivers.
Non-goals
Do not try to build a full TypeScript control-flow analyzer. Do not require type information. This rule should keep working in both the Deno lint plugin and the ESLint plugin surfaces.
Suggested checks
Add focused tests in packages/lint/src/tests/outbox-listener-delivery-required.test.ts. Existing positive cases should keep passing, especially the alias and named-listener cases.