fix: waitUntil Set leak and NaN port bypass in core utils#225
Conversation
- F4: capture the chained promise so the finally cleanup deletes the entry that was actually added to the Set (the original promise was never added), preventing unbounded Set growth per waitUntil() call. - F36: reject NaN ports (e.g. PORT=abc or PORT="") with a clear RangeError instead of an obscure downstream listen error. Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe utilities now validate port values more explicitly and report original inputs in errors. ChangesUtility behavior updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
Two small core-utils fixes from the v1 stabilization review.
waitUntilleaked memory on every call.createWaitUntiladded the chained.catch().finally()promise to the Set but the cleanup deleted the original promise (which was never added), so the Set grew unbounded on any long-running server. Now the chained promise is captured in a variable and that same promise is deleted on settlement.NaNbypassed the port range check.NaN < 0andNaN > 65535are both false, soPORT=abc/PORT=""slipped past the guard and failed later with an obscure listen error. Added aNumber.isNaNguard that throws a clearRangeError.Added
test/utils.test.tscovering both (leak-free after N resolved/rejectedwaitUntilcalls, andRangeErrorfor non-numeric/out-of-range ports).🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests