-
Notifications
You must be signed in to change notification settings - Fork 129
chore(rivetkit): log close code & reason in disconnect warning #3302
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
|
PR Review: Log close code & reason in disconnect warningSummaryThis PR enhances the WebSocket disconnect logging by passing the close code and reason from the WebSocket close event through to the onDisconnected callback, allowing for better debugging and observability of connection terminations. Code Quality: Good ✅Strengths:
Potential Issues: Minor Concerns
|
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
d6e9414 to
60414c4
Compare
3a63654 to
1a25cce
Compare
PR ReviewSummaryThis PR enhances observability by adding close code and reason parameters to the Code Quality ✅
Issues Found 🔴1. Missing update in test-runner (Breaking Change) onDisconnected: () => { },This needs to be updated to: onDisconnected: (code, reason) => { },Without this change, the test-runner will fail to compile due to the signature mismatch. Location: Recommendations 📋
Performance ✅No performance concerns - the changes are minimal and only add two primitive parameters to an existing callback. Security ✅No security concerns identified. Test Coverage
|
PR Review: chore(rivetkit): log close code & reason in disconnect warningSummaryThis PR enhances logging for WebSocket disconnections by adding the close code and reason to the onDisconnected callback and the associated warning log. This is a small but valuable improvement for debugging connection issues. Code Quality ✅Strengths:
Interface Changes:
Compatibility Analysis
|
60414c4 to
9854433
Compare
1a25cce to
80b8e25
Compare
PR Review: Log Close Code & Reason in Disconnect WarningSummaryThis PR enhances the Code Quality ✅Positive aspects:
Issues Found
|
PR Review: chore(rivetkit): log close code & reason in disconnect warningSummaryThis PR enhances observability by adding WebSocket close code and reason to the disconnect warning logs. The change propagates these values from the WebSocket close event through the runner's Code Quality ✅
Issues Found 🔴Breaking Change Not Fully AppliedThe signature of Missing update in: onDisconnected: () => { }, // ❌ Needs to accept (code, reason) parametersThis will cause a TypeScript compilation error or runtime issues. The callback should be updated to: onDisconnected: (_code, _reason) => { },Recommendations
Security & Performance ✅
Positive Notes ✨
Verdict |
80b8e25 to
c6e7414
Compare
Code ReviewSummaryThis PR improves observability by adding ✅ Positive Points
🔍 ObservationsBackward CompatibilityThis is a breaking change to the I verified the following files have been updated correctly:
Logging Pattern ComplianceThe logging in
💡 Suggestions1. Consider Type Safety for Optional ParametersIf you want to maintain backward compatibility in the future, consider making the parameters optional with TypeScript: onDisconnected: (code?: number, reason?: string) => void;However, since all call sites are internal and have been updated, the current approach is fine. 2. Add JSDoc DocumentationConsider adding JSDoc to the interface to document the WebSocket close codes: /**
* Called when the runner WebSocket disconnects
* @param code - WebSocket close code (see https://www.rfc-editor.org/rfc/rfc6455#section-7.4.1)
* @param reason - Human-readable close reason
*/
onDisconnected: (code: number, reason: string) => void;3. Consider Additional ContextThe 🎯 VerdictApproved ✅ This is a clean, well-executed change that improves debugging capabilities without introducing any bugs or security issues. The breaking change is acceptable given that all implementations are internal and have been updated. Test CoverageThe change doesn't require new tests since:
Great work on improving observability! 🎉 |
c6e7414 to
41fc7d5
Compare
554ce2a to
61614bc
Compare
Code ReviewSummaryThis PR enhances the Issues Found🔴 Breaking Change - Missing UpdateThe signature change to Location: onDisconnected: () => { },This needs to be updated to match the new signature: onDisconnected: (code, reason) => { },Impact: This will cause a TypeScript compilation error since the callback signature no longer matches the interface definition. Positive Observations✅ Good: The change improves observability by exposing WebSocket close codes and reasons in logs, which will aid in debugging connection issues. ✅ Good: The implementation correctly passes through the existing ✅ Good: Follows the repository's logging pattern from CLAUDE.md - using structured logging with parameters rather than formatting them into the message string. ✅ Good: The rivetkit implementation properly uses the new parameters in the structured log output. Recommendations
VerdictRequires Changes - Please fix the breaking change in test-runner before merging. Once the test-runner is updated, this is a clean improvement to the logging infrastructure. 👍 |
d0fce8f to
718535f
Compare
Code ReviewSummaryThis PR improves observability by adding Issues Found🚨 Breaking Change - Incomplete MigrationThe signature of onDisconnected: () => voidto: onDisconnected: (code: number, reason: string) => voidHowever, not all usages have been updated. This will cause TypeScript compilation errors: Needs to be updated:
Should be updated for consistency (commented code):
Recommendations
Positive Aspects✅ Improved observability: Adding close code and reason to logs will help with debugging connection issues TestingPlease ensure:
SeverityMedium - This PR introduces a compilation error that will prevent the codebase from building. The fix is straightforward but necessary before merging. |
271cad1 to
dcaa1af
Compare
718535f to
11ff7b7
Compare
|
Deployment failed with the following error: Learn More: https://vercel.com/docs/limits#rate-limits |
Code ReviewSummaryThis PR enhances the onDisconnected callback to include WebSocket close code and reason, improving observability when runner disconnections occur. The changes are minimal and focused. Positive Aspects
Issues FoundBreaking Change - Incomplete MigrationThe signature change to onDisconnected is a breaking change that affects other consumers in the codebase. This implementation is currently incomplete: File that needs updating:
This will cause a TypeScript compilation error since the callback now expects 2 parameters. Recommended fix: Update the callback to accept the two parameters (code, reason) even if they are not used. Note: The commented-out usages in lifecycle.test.ts:134 and benches/utils.ts:114 should also be updated when uncommented to prevent future issues. Minor Suggestions
Test CoverageNo tests were modified or added. Consider:
VerdictRequest Changes - The PR needs to update all implementations of onDisconnected to match the new signature before merging to avoid compilation errors. |
Merge activity
|
11ff7b7 to
f76b79c
Compare
PR Review: Add close code & reason to disconnect loggingSummaryThis PR enhances the logging for WebSocket disconnections by adding Code Quality ✅Strengths:
Areas for Improvement:
Testing 🧪Missing:
Recommendation: Since this changes a public interface, consider:
Performance ✅No performance concerns - this is a logging enhancement only. Security ✅No security concerns. The close code and reason are standard WebSocket protocol data. Best Practices ✅
Overall AssessmentApproved with minor suggestions ✅ This is a good improvement for debugging connection issues. The main concern is ensuring all consumers of the Action items:
|

No description provided.