-
Notifications
You must be signed in to change notification settings - Fork 130
fix(rivetkit): use loggerWithoutContext for websocket error when actor undefined #3412
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-07-feat_rivetkit_add_get__actors_names_
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
|
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: |
Code ReviewSummaryThis PR fixes a bug where actor.rLog was being accessed when the actor object was undefined in the error handler of handleWebSocketConnect. The fix correctly uses loggerWithoutContext() instead, which is appropriate since the actor failed to load. AnalysisThe Bug: The Fix: This is the correct approach because:
ObservationsConsistency:
Potential Related Issues: Test CoverageThe codebase appears to have driver tests in the tests/ directory. It would be valuable to add a test case that verifies proper error handling when loadActor fails, ensuring:
Consider adding a test that mocks actorDriver.loadActor to throw an error and verifies the onOpen handler closes the connection gracefully. VerdictLGTM - This is a correct bug fix that:
Suggestions:
Great catch on this edge case! |
5066d9c to
cb9465d
Compare
44ab040 to
c5ed5d6
Compare
Code Review: PR #3412SummaryThis PR fixes a bug where ✅ Positive Feedback
📋 Observations
🤔 Considerations
✨ VerdictLGTM - This is a clean, correct bug fix that prevents a potential runtime error. The change is minimal, follows existing patterns, and uses the appropriate logger for the context. The only suggestion would be to add test coverage for this specific error path to prevent future regressions. Suggested Test Scenario: // Test that websocket error handler works when actor loading fails
it('should handle websocket connection when actor fails to load', async () => {
// Mock actorDriver.loadActor to throw
// Attempt websocket connection
// Verify graceful error handling without accessing undefined actor.rLog
}); |
PR Review: fix(rivetkit): use loggerWithoutContext for websocket error when actor undefinedSummaryThis PR fixes a critical bug where the code attempts to access Code Quality ✅Positive aspects:
Analysis:
Potential Issues
|
c5ed5d6 to
819085b
Compare
cb9465d to
28c0736
Compare
Code ReviewSummaryThis PR fixes a bug where AnalysisBug Context: Fix:
Code Quality ✅Strengths:
Potential IssuesMinor Observation:
Test Coverage:
Performance ✅No performance concerns. The change doesn't affect the execution path. Security ✅No security concerns. The fix maintains the same error exposure behavior through Best Practices ✅Follows the repository's error handling patterns and logging conventions from CLAUDE.md. RecommendationLGTM ✅ This is a good bug fix that prevents a potential runtime error. The implementation is correct and follows existing patterns in the codebase. Optional follow-up: 🤖 Generated with Claude Code |

No description provided.