-
Notifications
You must be signed in to change notification settings - Fork 135
chore(engine-runner): remove echo close on ToClientWebSocketClose #3487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11-13-chore_rivetkit_implement_new_hibernating_ws_protocol
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Code ReviewI've reviewed this PR and the changes look good overall. The PR removes the echo close behavior on Summary of ChangesThe PR modifies two TypeScript files in the engine runner SDK:
AnalysisProtocol Correctness ✅ Based on the protocol schema (
Behavioral Impact ✅ Looking at protocol::ToServerTunnelMessageKind::ToServerWebSocketClose(close) => {
if can_hibernate && close.hibernate {
return Err(WebSocketServiceHibernate.build());
} else {
return Ok(LifecycleResult::ServerClose(close));
}
}Since
Code Quality ✅
Potential ConcernsMinor: Protocol Field Unused 🟡 The Question: Zombie Connection Cleanup ❓ In Recommendations✅ Approve: The changes are correct and improve code clarity. The removal of the echo close behavior aligns with the documented architecture where hibernation is managed by the gateway, not the runner. Suggestion: Consider adding a comment in the protocol schema or documentation explaining that Test Coverage: Ensure integration tests cover:
Great cleanup! 🎉 |
647d688 to
debe04e
Compare
972242d to
556b074
Compare
556b074 to
972242d
Compare
debe04e to
647d688
Compare
Updated Code ReviewI've reviewed this PR again with fresh analysis. The changes are solid and correctly simplify the WebSocket close handling. SummaryThis PR removes the runner's ability to echo close messages with the Key Changes Analysis1. Protocol Alignment ✅ The
2. Removed Complexity ✅
3. Behavioral Correctness ✅ The timeout handler change (tunnel.ts:516) from
4. Error Message Improvement 👍 Line 400 improves logging: "cannot send tunnel message, socket not connected to engine. tunnel data dropped." - more explicit about data loss. Testing ObservationsThe test file (lifecycle.test.ts) is currently commented out. While this PR's changes are straightforward, consider:
Minor Suggestions
Verdict✅ LGTM - Clean refactoring that correctly implements the architecture. The removal of echo close behavior and the Files reviewed:
|
Code ReviewThanks for this cleanup! This PR simplifies the WebSocket close handling by removing the ✅ Positive Changes
🔍 Observations & Questions
🐛 Potential Issues
🧪 Test CoverageThe test file
📋 Minor Suggestions
🎯 SummaryOverall this is a good cleanup PR that simplifies the close handling. The main concern is the potential for echoing close messages when the engine initiates the close. I'd recommend addressing the callback flag in Recommendation: Request changes to fix the potential close message echo issue before merging. |
Code ReviewSummaryThis PR removes the hibernate parameter echo behavior from WebSocket close operations. The changes simplify the close flow by always setting Positive Changes ✅
Issues & Concerns 🔍1. Breaking Protocol Change - Needs DocumentationThe export type ToServerWebSocketClose = {
readonly code: u16 | null
readonly reason: string | null
readonly hibernate: boolean // Still present in protocol
}Issue: While the client now always sends Recommendations:
2. Inconsistent Behavior with Hibernatable WebSocketsThe code still has hibernatable WebSocket support ( // Only close non-hibernatable websockets to prevent sending
// unnecessary close messages for websockets that will be hibernated
if (\!ws[HIBERNATABLE_SYMBOL]) {Issue: There's a disconnect between:
Questions:
3. Potential Race Condition in Timeout HandlerAt webSocket.close(1000, "ws.ack_timeout");Issue: The Question: Is this the intended behavior? The timeout already indicates a network/communication issue, so echoing a close message might be redundant. 4. Missing Test CoverageNo test changes were included in this PR. Recommendations:
Code QualityGood:
Suggestions:
Security & Performance✅ No security concerns identified RecommendationConditional Approval - The code changes are sound, but need:
Please address the issues mentioned above before merging. |
PR Review: Remove Echo Close on ToClientWebSocketCloseSummaryThis PR simplifies the WebSocket close flow by removing the Code Quality & Best Practices ✅Positive:
Suggestions:
Potential Issues
|
647d688 to
debe04e
Compare
972242d to
556b074
Compare
Code ReviewI've reviewed this PR and found a critical issue that needs to be addressed before merging. Critical Issue: Breaking WebSocket Hibernation FeatureThe PR removes the Evidence from if can_hibernate && close.hibernate {
return Err(WebSocketServiceHibernate.build());
} else {
// Successful closure
return Ok(LifecycleResult::ServerClose(close));
}Impact:
Specific Issues:
Questions for Clarification
RecommendationsIf removing hibernation is intentional:
If hibernation should be preserved:
Minor Issues
Code QualityThe code changes themselves are clean and well-structured, but the semantic implications for the WebSocket lifecycle need clarification before merging. Verdict: ❌ Request Changes - Need clarification on hibernation removal intent and corresponding engine updates if this is intentional. |
Code ReviewSummaryThis PR removes the hibernate parameter from WebSocket close handling in the TypeScript runner. The change simplifies the close callback by always setting Code Quality ✅Good:
Concerns:
Potential Bugs 🐛
Security Concerns 🔒No security issues identified. The changes reduce attack surface by removing functionality. Performance Considerations ⚡
Test Coverage 🧪Concerns:
Recommendations
Questions for Author
VerdictConditional Approval - The code changes are clean and well-executed, but need clarification on:
If hibernation removal is intentional, consider this as part 1 of a larger refactor. |
556b074 to
972242d
Compare
debe04e to
647d688
Compare
Code ReviewI've reviewed PR #3487 and here's my feedback: SummaryThis PR removes the hibernate functionality from the WebSocket close callback in the engine runner. The changes simplify the close callback by removing the Code Quality ✅Positive aspects:
Changes Analysiswebsocket-tunnel-adapter.ts
tunnel.ts
Potential Issues & Questions 🤔
Performance & Security ✅
Test Coverage
|
Code ReviewSummaryThis PR removes the AnalysisChanges:
Server-side Impact: if can_hibernate && close.hibernate {
return Err(WebSocketServiceHibernate.build());
} else {
return Ok(LifecycleResult::ServerClose(close));
}With Concerns & Questions1. Intended Behavior Change
2. Protocol Consistency
3. Missing Context
4. Logging Improvement
RecommendationsBefore merging:
Code quality: ✅ The changes are clean and simplify the codebase VerdictThe code changes are well-executed, but needs clarification on whether removing hibernate-on-close is intentional and what impact this has on production systems. Please provide context in the PR description before merging. |
647d688 to
debe04e
Compare
972242d to
556b074
Compare
Code ReviewSummaryThis PR removes the hibernate parameter functionality from WebSocket close operations in the TypeScript runner. The changes simplify the close callback signature and always set ✅ Positive Aspects
🔍 Potential Concerns1. Breaking Change Without ContextThe PR removes hibernation support from the TypeScript runner, but the if can_hibernate && close.hibernate {
return Err(WebSocketServiceHibernate.build());
}Questions:
2. Timeout Handling ChangeIn tunnel.ts:516, the timeout handler was changed from: webSocket._closeWithHibernate(1000, "Message acknowledgment timeout");to: webSocket.close(1000, "ws.ack_timeout");The close reason changed from "Message acknowledgment timeout" to "ws.ack_timeout". While the new format is more machine-readable, this could be a breaking change if any downstream systems parse these close reasons. Recommendation: Document this change in the commit message or PR description if it's intentional. 3. Comment AccuracyAt tunnel.ts:1070, the comment states: // We don't need to send a close responseThis comment seems slightly misleading. The code does call Wait, I need to verify this... Looking at websocket-tunnel-adapter.ts:232: _handleClose(_requestId: ArrayBuffer, code?: number, reason?: string): void {
this.#closeInner(code, reason, true);
}And However, looking at tunnel.ts:1067-1077, this is handling 4. Protocol Definition MismatchThe
🧪 Testing Concerns
🔒 Security & PerformanceNo security concerns identified. The changes are straightforward refactoring without introducing new attack vectors. Performance impact is negligible - if anything, it's slightly improved by removing unused code paths. 📝 Recommendations
✨ Code Quality
Overall Assessment: The code changes are clean and well-executed, but the PR lacks context about why hibernation is being removed. This makes it difficult to assess whether this is the right approach or if it introduces unintended side effects. I'd recommend adding more context before merging. |
Code ReviewThis PR removes the echo close functionality when receiving a Summary of ChangesThe PR makes the following key changes:
Code Quality ✅Positive aspects:
Type Safety:
Behavioral Changes
|
debe04e to
647d688
Compare
556b074 to
972242d
Compare
Code Review - PR #3487I've reviewed this PR which removes the echo close behavior on Summary of ChangesFiles Modified:
Key Changes:
Analysis✅ Code Quality & Best PracticesPositive:
🔍 Architectural CorrectnessLooking at the server-side code (pegboard-gateway/src/lib.rs:428-433): if can_hibernate && close.hibernate {
return Err(WebSocketServiceHibernate.build());
} else {
return Ok(LifecycleResult::ServerClose(close));
}This PR is architecturally correct:
🎯 Behavioral Impact
|
PR Review: Remove echo close on ToClientWebSocketCloseSummaryThis PR removes the hibernate echo functionality from WebSocket close handling in the TypeScript runner SDK. The changes simplify the close flow by removing the Code Quality ✅Strengths:
Observations:
Potential Issues
|

No description provided.