Skip to content

[workflows-shared] fix waitForEvent delivering events to stale waiters after timeout#12985

Merged
pombosilva merged 1 commit into
mainfrom
osilva/fix-workflows-waitForEvent
Mar 20, 2026
Merged

[workflows-shared] fix waitForEvent delivering events to stale waiters after timeout#12985
pombosilva merged 1 commit into
mainfrom
osilva/fix-workflows-waitForEvent

Conversation

@pombosilva
Copy link
Copy Markdown
Contributor

@pombosilva pombosilva commented Mar 20, 2026

Fixes #11740

When a step.waitForEvent() times out, its resolve callback was not being removed from the Engine's waiters map. This meant the next waitForEvent call for the same event type would have its event consumed by the stale dead callback, causing that next live waiter to never resolve.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: e6550cd

The changes in this PR will be included in the next version bump.

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Mar 20, 2026
@pombosilva pombosilva force-pushed the osilva/fix-workflows-waitForEvent branch from 9291595 to 6e25146 Compare March 20, 2026 14:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2026

✅ All changesets look good

@pombosilva pombosilva marked this pull request as ready for review March 20, 2026 14:07
@pombosilva pombosilva requested review from a team as code owners March 20, 2026 14:07
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 20, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 20, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12985

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12985

miniflare

npm i https://pkg.pr.new/miniflare@12985

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12985

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12985

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12985

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12985

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12985

wrangler

npm i https://pkg.pr.new/wrangler@12985

commit: e6550cd

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pombosilva pombosilva force-pushed the osilva/fix-workflows-waitForEvent branch from 6e25146 to 53b24bd Compare March 20, 2026 14:12
@pombosilva pombosilva force-pushed the osilva/fix-workflows-waitForEvent branch from 53b24bd to e6550cd Compare March 20, 2026 14:21
@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Mar 20, 2026
@pombosilva pombosilva changed the title [Workflows] fix waitForEvent delivering events to stale waiters after timeout [workflows-shared] fix waitForEvent delivering events to stale waiters after timeout Mar 20, 2026
@pombosilva pombosilva merged commit 17a57e6 into main Mar 20, 2026
59 of 63 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Mar 20, 2026
@pombosilva pombosilva deleted the osilva/fix-workflows-waitForEvent branch March 20, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Workflows] waitForEvent skips events after timeout in local development (wrangler dev)

4 participants