use TryWriteAll for close session capsules - #348
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #348 +/- ##
==========================================
- Coverage 72.36% 71.93% -0.43%
==========================================
Files 15 15
Lines 1715 1714 -1
==========================================
- Hits 1241 1233 -8
- Misses 375 382 +7
Partials 99 99 ☔ View full report in Codecov by Harness. |
📝 WalkthroughWalkthroughThe quic-go dependency is updated, ChangesSession close write behavior
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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.
🧹 Nitpick comments (1)
session_test.go (1)
34-34: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExercise the new write behavior in tests.
The no-op mock only satisfies the interface; it cannot verify the capsule bytes or the error path that triggers
CancelWrite. Add a recording/error-injectable mock covering both successful and failedTryWriteAllcalls.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@session_test.go` at line 34, Add a recording, error-injectable mock implementation for mockHTTP3Stream.TryWriteAll that captures written capsule bytes and can return a configured error. Update the relevant tests to assert the successful write payload and verify the failed-write path triggers CancelWrite, while preserving the existing interface behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@session_test.go`:
- Line 34: Add a recording, error-injectable mock implementation for
mockHTTP3Stream.TryWriteAll that captures written capsule bytes and can return a
configured error. Update the relevant tests to assert the successful write
payload and verify the failed-write path triggers CancelWrite, while preserving
the existing interface behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f3ddee7-ab51-473e-a190-0eb0b7bd2a45
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (3)
go.modsession.gosession_test.go
Blocked on the quic-go v0.62.0 release.
Note
Use
TryWriteAllfor writing close session capsules incloseSessionStreamReplaces the write deadline +
Writepattern incloseSessionStreamwith a call tostr.TryWriteAllwhen sending close capsules. Also updates thehttp3Streaminterface to includeTryWriteAll([]byte) errorand bumpsgithub.com/quic-go/quic-goto a pre-release version that exposes this method.Macroscope summarized 7a002c3.
Summary by CodeRabbit
Bug Fixes
Maintenance