Category: clean-code Severity: minor
Location: packages/runtime/src/job-runner.ts:682-691
What
subscriberBroadcaster's only consumer passes it into wrapJobCtx as the unused required field broadcast (job-runner-helpers.ts:52-74, destructured nowhere), so the method is never actually invoked; subscriber fan-out happens via the SessionContext.send pipeline instead. Dead code that implies fan-out happens here.
Evidence
private subscriberBroadcaster(job: Job): SubscriberBroadcaster {
return (env: BaseEnvelope) => {
const subs = this.server.subscribers.get(job.jobId);
if (subs === undefined || subs.size === 0) return;
for (const sub of subs) {
void forwardEventToSubscriber(sub, env).catch(() => undefined);
Proposed fix
Delete subscriberBroadcaster and the broadcast field on WrapJobCtxArgs (and the runHandler construction), or hook it into a single live fan-out path.
Acceptance criteria
Category: clean-code Severity: minor
Location:
packages/runtime/src/job-runner.ts:682-691What
subscriberBroadcaster's only consumer passes it into wrapJobCtx as the unused required field
broadcast(job-runner-helpers.ts:52-74, destructured nowhere), so the method is never actually invoked; subscriber fan-out happens via the SessionContext.send pipeline instead. Dead code that implies fan-out happens here.Evidence
Proposed fix
Delete subscriberBroadcaster and the broadcast field on WrapJobCtxArgs (and the runHandler construction), or hook it into a single live fan-out path.
Acceptance criteria