Files
vercel__workflow/.changeset/fix-world-local-step-created-race.md
Nathan Rajlich 92dc82608a Atomically dedupe duplicate step_created/wait_created events in world-local (#1877)
Concurrent invocations producing identical correlationIds (as the snapshot
runtime does by design across replays) previously both succeeded and
persisted duplicate events. step_created had no guard at all; wait_created
used a TOCTOU read-then-check that allowed both writers through under
concurrency. Both now claim a per-(runId, correlationId) constraint file
with O_CREAT|O_EXCL before writing, so the loser surfaces as
EntityConflictError — which the runtime's dedup catch path already
handles.
2026-05-04 00:21:53 +00:00

225 B

@workflow/world-local
@workflow/world-local
patch

Fix race in events.create() where concurrent step_created / wait_created writes with the same correlationId would both succeed instead of one losing with EntityConflictError.