mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
08318f6da0
Review follow-ups on #4100: - The queue-owned row no longer sends a backstop per running step per replay. The dispatch pass folds every queue-owned running step into ONE delayed run continuation, due when the latest bare start's lease expires and keyed `${runId}:queue-backstop:${latestStartedAt}`. The invocation remembers the epochs it armed and skips the send on later passes over an unchanged log, so three replay passes over one running step (or one pass over N running steps) cost a single publish; concurrent invocations collapse onto one pending wake server-side via the shared key. A coarser bucket key would either be deduped against an in-flight wake that fires before a newer step's lease expires, or need a delay past the queue's per-message cap, so the epoch is the key. A wake on a finished run is the ordinary already-terminal exit. - `isQueueOwnedRunning` additionally requires the run's specVersion to be at or above SPEC_VERSION_SUPPORTS_SLOT_IDENTITY (6), the first spec version every ownership-stamping runtime mints (#2848 shipped under spec 5). A bare start on an older or unknown run is not proof of a queue delivery, since the replay contract tolerates a legacy unstamped inline start, so such runs keep the immediate re-enqueue. - `workflow.queue_ownership.backstop_wakes_armed` is now 0/1 per pass. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>