fix(node): do not reclaim READY SAB slots in beginFrame#214
fix(node): do not reclaim READY SAB slots in beginFrame#214RtlZeroMemory merged 3 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an option to SAB slot acquisition to prevent reclaiming READY slots under pressure and updates Node backend calls to use it; also adds a unit test exercising the new behavior and adjusts an e2e test's oversized-paste detection. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/node/src/__e2e__/terminal_io_contract.e2e.test.ts`:
- Around line 896-904: The test block around
oversizedPaste/findIndex/assert.equal is failing formatting; run the project's
formatter (Prettier) or lint autofix to reformat this snippet so it matches
project style (e.g., run npm run lint -- --fix or the repo's formatter) and
commit the formatted changes; focus on the lines referencing oversizedEvents,
findIndex, textDecoder.decode(ev.bytes).includes(oversizedMarker),
oversizedPaste, and the assert.equal call to ensure spacing/line breaks match
project formatting rules.
Summary
beginFrame()with READY reclamation disabled, so beginFrame only uses FREE slotsbeginFrame()returnsnullunder single-slot READY pressure instead of reclaiming a published slotWhy
Reclaiming a READY slot in
beginFrame()creates a window where the worker can still observe old mailbox metadata but find slot state changed to WRITING with the same token, which can escalate to a backend fatal.Testing
npm run build -- --pretty falsenode --test --test-concurrency=1 packages/node/dist/__tests__/worker_integration.test.jsSummary by CodeRabbit
Bug Fixes
Tests