Relationships
#3309 workflow resume refuses a wait that has an applicable pending signal
Opened by zack · 10/12/2026· Shipped 10/13/2026
Problem
Follow-up to swamp-club#3212 (early signals, acceptEarly), found while validating the feature end to end.
When a signaller stops between storing its pending signal and reading the key again, a wait can be open with an applicable pending signal that nothing has given it yet. swamp workflow resume on that run answers that the step is still waiting for a signal and to run workflow signal first.
The design doc ("Every reader finishes the job", design/primitives/workflows.md) says a resume takes the signal. findUnsettledWait in src/domain/workflows/signal_wait_cleanup.ts checks only whether the wait has an outcome record; it does not give the wait its key's pending signal first.
The other readers do the right thing: workflow waits, a second signal by key, and serve's sweep all take the pending signal for the wait. So the impact is small, and it only arises after a signaller dies mid-arrival, but the command contradicts the documented behaviour and sends the user to signal a wait that already has its signal.
Suggested fix
Have resume give each open wait of the run its pending signal (as outcomeAt / takePendingSignalsOfRun do) before findUnsettledWait decides a wait is unsettled. Add a test: a pending record in the wait's slot, no outcome, and resume succeeds the step with the signal's payload.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.