fix(node/web): do not swallow getReader errors#199
Conversation
commit: |
📝 WalkthroughWalkthroughA new private Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
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 `@src/adapters/_node/web/socket.ts`:
- Around line 102-108: In bodyReader(), don't call this.emit("error", error)
directly; call this.destroy(error) so the Duplex's _destroy(err, cb) override
handles teardown consistently—update the bodyReader method in the class
containing bodyReader() to invoke this.destroy(error) in the catch block (the
class already implements _destroy), ensuring stream state/teardown is handled
via the standard Node.js pattern rather than raw emit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47f67aca-1816-4276-83e0-8c18d74a9ae2
📒 Files selected for processing (1)
src/adapters/_node/web/socket.ts
getReader errorsgetReader errors
Fixes #198
Summary by CodeRabbit