refactor(dash-spv): drop unreachable WouldBlock/TimedOut#753
Conversation
Tokio's `AsyncReadExt::read` consumes `WouldBlock` inside the runtime, so the future never resolves with that error kind. Read timeouts are imposed via `tokio::time::timeout(..)` and surface as `Elapsed`, not `io::Error::TimedOut`. The four `match` blocks in `Peer::receive_message`'s framing loop kept arms for both kinds, all of which were dead code. Drop the eight unreachable arms. The remaining `Ok(0)`, `Ok(_)`, `ConnectionAborted`/`ConnectionReset`, and catch-all `Err(e)` arms continue to surface real errors, with the catch-all converting any unanticipated `io::Error` into `NetworkError::ConnectionFailed` rather than silently masking it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR removes special-case error handling in the ChangesPeer Message Read Error Handling
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 docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #753 +/- ##
==========================================
Coverage 72.22% 72.23%
==========================================
Files 320 320
Lines 69631 69615 -16
==========================================
- Hits 50294 50287 -7
+ Misses 19337 19328 -9
|
Tokio's
AsyncReadExt::readconsumesWouldBlockinside the runtime, so the future never resolves with that error kind. Read timeouts are imposed viatokio::time::timeout(..)and surface asElapsed, notio::Error::TimedOut. The fourmatchblocks inPeer::receive_message's framing loop kept arms for both kinds, all of which were dead code.Drop the eight unreachable arms. The remaining
Ok(0),Ok(_),ConnectionAborted/ConnectionReset, and catch-allErr(e)arms continue to surface real errors, with the catch-all converting any unanticipatedio::ErrorintoNetworkError::ConnectionFailedrather than silently masking it.Summary by CodeRabbit