Repository navigation
fix: handle prototype-colliding external event names - #384
Merged
Merged
Conversation
Initialize received and pending event dictionaries without inherited properties so constructor and __proto__ route to event queues. Add public in-memory client/worker regressions for both arrival orders, case-insensitive matching, FIFO, falsy payloads, and continue-as-new replay. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b5bc4dcd-bd3b-4767-92b5-12338c9f1ceb
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation correctly addresses prototype collisions and is backed by comprehensive tests.
0 open findings
What changed in this PR
Fixes external-event routing for names that collide with JavaScript object properties.
Changes:
- Uses prototype-free event dictionaries.
- Adds routing, FIFO, falsy-payload, replay, and continue-as-new regressions.
- Documents the fix in the changelog.
| File | Description |
|---|---|
runtime-orchestration-context.ts |
Creates prototype-free event dictionaries. |
external-event-routing.spec.ts |
Adds comprehensive regression coverage. |
CHANGELOG.md |
Records the external-event fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kaibocai (kaibocai)
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix external-event routing for valid names that collide with JavaScript object properties, including
constructorand__proto__.What changed?
Why is this change needed?
constructorfailed before event delivery; an earlyconstructoror__proto__event failed the orchestration instead of being buffered.Issues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
external-event-routing.spec.ts,CHANGELOG.md, and this description.AI verification (required if AI was used):
Testing
Automated tests
TypeErrorfailure details; the other 9 new cases and 13 existing controls passed. The same focused selection then passed all 32 tests.npm run test:unit -w @microsoft/durabletask-js -- --silent- passed: 86 suites, 1,715 tests, including all 19 new regressions and existing empty-name/null-payload controls.npm run build:core- passed..\node_modules\.bin\eslint.cmd packages\durabletask-js\src\worker\runtime-orchestration-context.ts packages\durabletask-js\test\external-event-routing.spec.ts- passed.git diff --check origin/main...HEAD- passed.Manual validation (only if runtime/behavior changed)
TestOrchestrationClient,TestOrchestrationWorker, and in-memory backend; no external service.constructor,Constructor,__proto__, and normal/mixed-case controls. All completed with the exact raised payload; the original constructor and early-event failures are gone.[false, 0], and carry events into a new execution before a fresh event. Results preserve order and once-only consumption:[false, 0]and[false, 0, "fresh"].Notes for reviewers
__proto__listener-first case already worked before the fix and remains covered; the failing__proto__case was event-before-listener routing.