fix(core): skip replay after terminal event refresh#2215
Conversation
🦋 Changeset detectedLatest commit: 0658e32 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Benchmark Results
workflow with no steps💻 Local Development
workflow with 1 step💻 Local Development
workflow with 10 sequential steps💻 Local Development
workflow with 25 sequential steps💻 Local Development
workflow with 50 sequential steps💻 Local Development
Promise.all with 10 concurrent steps💻 Local Development
Promise.all with 25 concurrent steps💻 Local Development
Promise.all with 50 concurrent steps💻 Local Development
Promise.race with 10 concurrent steps💻 Local Development
Promise.race with 25 concurrent steps💻 Local Development
Promise.race with 50 concurrent steps💻 Local Development
workflow with 10 sequential data payload steps (10KB)💻 Local Development
workflow with 25 sequential data payload steps (10KB)💻 Local Development
workflow with 50 sequential data payload steps (10KB)💻 Local Development
workflow with 10 concurrent data payload steps (10KB)💻 Local Development
workflow with 25 concurrent data payload steps (10KB)💻 Local Development
workflow with 50 concurrent data payload steps (10KB)💻 Local Development
Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
stream pipeline with 5 transform steps (1MB)💻 Local Development
10 parallel streams (1MB each)💻 Local Development
fan-out fan-in 10 streams (1MB each)💻 Local Development
SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
❌ Some benchmark jobs failed:
Check the workflow run for details. |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests▲ Vercel Production (4 failed)express (2 failed):
hono (1 failed):
nextjs-turbopack (1 failed):
💻 Local Development (1 failed)nextjs-turbopack-stable-lazy-discovery-disabled (1 failed):
📦 Local Production (1 failed)express-stable (1 failed):
Details by Category❌ ▲ Vercel Production
❌ 💻 Local Development
❌ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
15057e7 to
ebfe9ea
Compare
15329d3 to
a651052
Compare
|
No backport to This commit explicitly forward-ports stable PR #2214 to To override, re-run the Backport to stable workflow manually via |
Summary
Forward-ports the terminal run event replay guard from stable PR #2214 to
main's refactored runtime path.mainalready skipped replay when the initially loaded/preloaded event snapshot contained a terminal run event. This adds the same terminal-event check after the elapsed-wait completion path refreshes the event snapshot, so a concurrently recordedrun_failed,run_cancelled, orrun_completedends the current delivery instead of being passed into workflow replay as an orphaned event.Root Cause
A handler can load a running materialized run and an event snapshot, complete an elapsed wait, then refresh events before replaying. If another handler records a terminal run event during that refresh window, the refreshed event log already establishes the run outcome even though this handler's materialized
workflowRun.statusis stillrunning.Without a post-refresh terminal check,
runWorkflowcan see the terminal event as unrelated replay input and the runtime can record or queue an additional divergence/failure path for a run that is already terminal.Validation
fnm exec --using v22.18.0 pnpm installfnm exec --using v22.18.0 pnpm --filter '@workflow/core...' buildfnm exec --using v22.18.0 pnpm --dir packages/core exec vitest run src/runtime.test.ts src/runtime/wait-completion-replay.test.tsgit diff --checkfnm exec --using v22.18.0 pnpm exec biome check packages/core/src/runtime.ts packages/core/src/runtime/wait-completion-replay.test.ts .changeset/terminal-run-event-replay-main.mdValidation caveat: the Biome check completed with the pre-existing
runtime.tscomplexity warnings and the existing unused suppression warning around the constant replay loop; no formatting fixes were applied.