Skip to content

Client binds job.accepted to submits by FIFO order, mis-binding out-of-order acceptances #128

@nficano

Description

@nficano

Category: bug Severity: minor
Location: packages/client/src/client-dispatch.ts:340-355

What

Pending submissions are bound to incoming job.accepted purely by FIFO pendingAccepts.shift(), with no correlation to the originating envelope id. If the runtime accepts concurrent submits out of order, each job.accepted binds to the wrong invocation (wrong jobId/lease/credentials on the handle).

Evidence

function onJobAccepted(
  target: DispatchTarget,
  payload: JobAcceptedPayload,
): void {
  const inv = target.pendingAccepts.shift();
  if (inv === undefined || inv.acceptance.settled) return;

Proposed fix

Correlate job.accepted back to the originating submit via the in-reply-to/origin id instead of positional FIFO.

Acceptance criteria

  • Out-of-order job.accepted responses bind each handle to its own submit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit/bugAudit: bug / correctnesssev/minorSeverity: minor

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions