-
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
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. |
|
Detailed Analysis: Changes Made:
Protocol Impact: Behavior Changes:
Recommendations:
|
|
Positive Notes: Code Quality: The implementation is clean with good code removal practices. The simplification of #closeInner() method signature makes the code easier to understand. Improved Logging: The enhanced warning message at tunnel.ts:400 now explicitly states "tunnel data dropped" which will help with debugging. No Security/Performance Issues: No security concerns or performance regressions identified. The code itself is well-executed - the main question is whether the behavioral change (disabling hibernation) is intentional and properly coordinated with the rest of the system. |
PR Review: Remove echo close on ToClientWebSocketCloseSummaryThis PR removes the hibernate parameter from WebSocket close callbacks and simplifies the close handling logic in the runner. The change aligns with the new hibernating WebSocket protocol where the engine/gateway automatically handles hibernation without requiring explicit signals from the runner. Code Quality ✅Positive aspects:
Alignment with architecture: Correctness ✅Protocol alignment: The PR correctly sets this to
Close handling flow:
Important observation:
Potential Issues
|
7410ff0 to
f50891c
Compare
95c2777 to
5046fa3
Compare
PR Review: Remove echo close on ToClientWebSocketCloseSummaryThis PR removes the hibernate functionality from the WebSocket close mechanism in the TypeScript runner by:
Code Quality & Best Practices ✅Positive observations:
Minor concerns:
Potential Issues 🔍Type inconsistency: #closeCallback: (
code?: number,
reason?: string,
hibernate?: boolean,
) => void;But the constructor at line 68 and all call sites now use: closeCallback: (code?: number, reason?: string) => voidRecommendation: Update the field type definition to match the new signature (remove Protocol Compliance
|
Code ReviewSummaryThis PR removes the Code Quality ✅Positive aspects:
Minor improvements needed:
Potential Issues & Questions
|
5046fa3 to
95c2777
Compare
f50891c to
7410ff0
Compare
PR Review: Remove echo close on ToClientWebSocketCloseSummaryThis PR removes the hibernate parameter functionality from WebSocket close handling in the TypeScript runner, always setting it to Code Quality & Best Practices ✅Positive Changes:
Minor Observations:
Potential Issues & Questions
|
7410ff0 to
f50891c
Compare
95c2777 to
5046fa3
Compare
Code ReviewSummaryThis PR simplifies WebSocket close handling by removing the hibernate parameter from the close callback chain and always setting it to false when sending close messages to the server. Positive Aspects
Code Quality ObservationsGood:
Concerns:
Test CoverageConcern: No test changes included
Recommendation: Add test coverage in a follow-up PR Security and Performance
Suggestions
Approval StatusThe code changes are sound and safe to merge with these notes:
Recommendation: Approve with suggestion to add tests in a follow-up PR. |
5046fa3 to
95c2777
Compare
PR Review: Remove echo close on ToClientWebSocketCloseI've reviewed this PR and the changes look good overall. Here's my detailed feedback: ✅ Strengths
🔍 Observations & Questions
🧪 Test CoverageThe test file at Recommendation: Since this PR modifies critical WebSocket close behavior, it would be valuable to:
🛡️ Security & CorrectnessNo security concerns identified. The changes don't introduce any obvious vulnerabilities. One potential issue: The change ensures we always send 📝 Code Quality
💡 Suggestions
SummaryThis is a clean refactoring that simplifies the WebSocket close logic. The main question is whether always setting Recommendation: ✅ Approve pending verification of server-side hibernate handling |
Merge activity
|

No description provided.