Skip to content
Commit Detail

Commit 20dfcb7

Author
Harris Hancock <harris@cloudflare.com> 2025-04-03 15:42:31 +0100
Parents
dfe45a8
Tree
8b83fa9
EW-9182 Add assertion to detect timeout ID generator mismatches

Add instrumentation to verify that the TimeoutId::Generator being used belongs
to the ServiceWorkerGlobalScope associated with the current IoContext. This will
help diagnose potential timeout ID collisions caused by generators being used
with the wrong IoContext.

- Add getTimeoutIdGenerator() method to Worker::Lock
- Add assertion in TimeoutManagerImpl::setTimeout to validate generator
- This will fail early with a descriptive error if the invariant is violated

🤖 Generated with Claude, then lightly edited by Harris Hancock.

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed

3 files changed~3 modified