-
Notifications
You must be signed in to change notification settings - Fork 135
chore(rivetkit): make action cancelled error more descriptive #3500
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: graphite-base/3500
Are you sure you want to change the base?
chore(rivetkit): make action cancelled error more descriptive #3500
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR Review: Make action cancelled error more descriptiveThanks for this improvement! The changes enhance debuggability by providing more context in error messages. Here's my analysis: ✅ Code Quality & Best PracticesRust Change (pegboard-gateway/src/lib.rs:657)
TypeScript Change (rivetkit/src/client/actor-conn.ts:534)
🔍 Potential Issues1. Missing Error Handling for Undefined Values // Current (line 534):
`${wasClean ? "Connection closed" : "Connection lost"} (code: ${closeEvent.code}, reason: ${closeEvent.reason})`
// Could produce:
"Connection lost (code: undefined, reason: undefined)"Recommendation: Add fallback values for better error messages: const disconnectError = new Error(
`${wasClean ? "Connection closed" : "Connection lost"} (code: ${closeEvent.code ?? 'unknown'}, reason: ${closeEvent.reason || 'none'})`,
);Note that lines 509 and 516-517 already use these values directly, so this change maintains consistency, but defensive programming would improve robustness. ⚡ Performance Considerations
🔒 Security Concerns
🧪 Test CoverageObservations:
Recommendation: Consider adding a test case that:
Example test structure: test("should include close code and reason in action error when connection closes", async (c) => {
const { client } = await setupDriverTest(c, driverTestConfig);
const conn = client.connStateActor.getOrCreate().connect();
try {
// Start an action that will be interrupted
const actionPromise = conn.someLongRunningAction();
// Force close the connection
await conn.dispose();
// Verify the error message
await expect(actionPromise).rejects.toThrow(/code:.*reason:/);
} catch (e) {
// Verify error contains diagnostic info
}
});📋 SummaryStrengths:
Suggestions:
Overall Assessment: ✅ Approved with minor suggestions The changes are valuable and safe to merge. The suggestions are optional improvements that would make the error handling even more robust. |
… connections and during hibernation
0f48573 to
3b027cc
Compare
b2fd01f to
1743afe
Compare
Code ReviewThis PR improves error messages by adding more diagnostic information. The changes are small but valuable for debugging. Positive Points
Observations and SuggestionsTypeScript Change (rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:534) Potential Issue: The closeEvent.code and closeEvent.reason properties might be undefined in some contexts, particularly in Node.js environments. Looking at line 499-502, there is a comment acknowledging that CloseEvent properties may be undefined in Node.js. The current implementation may produce messages like "Connection lost (code: undefined, reason: undefined)" in Node.js environments. Recommendation: Add defensive handling for undefined values with nullish coalescing to ensure consistent formatting. Rust Change (engine/packages/pegboard-gateway/src/lib.rs:657) Looks good: The change from "received message" to "received websocket message" improves clarity. This distinguishes it from other types of messages like NATS messages. Style check: Follows CLAUDE.md logging conventions - lowercase message. Security and Performance
Overall Assessment
Verdict: Approve with minor recommendation to handle undefined values in the TypeScript change using nullish coalescing operators. |
Code Review - PR 3500SummaryThis PR improves error messaging and logging clarity in two places:
StrengthsImproved Debuggability Consistency Low Risk Observations and Suggestions1. TypeScript: Potential Undefined Values 2. Test Coverage VerdictLGTM with minor suggestion - The changes improve debugging experience with minimal risk. The only recommendation is to handle potentially undefined code/reason values in the TypeScript change. Code Quality Metrics
|
|
Code Review Thanks for the improvements to error messages and logging. This PR makes debugging connection issues easier. POSITIVES:
OBSERVATIONS: TypeScript Change (actor-conn.ts:534): Rust Change (pegboard-gateway/src/lib.rs:657): OTHER CONSIDERATIONS:
RECOMMENDATION: Approve (with optional consideration of undefined handling in TypeScript) |
4f58c50 to
8b84eb1
Compare
208a8fa to
db9062e
Compare
8b84eb1 to
b1dae1e
Compare
…ck actor started after sub when hibernating
db9062e to
bd44aa4
Compare
b1dae1e to
b6dfb0d
Compare
Code ReviewSummaryThis PR improves error messaging by adding more context to log messages and error outputs. The changes are minimal but provide better debugging information. ✅ Code Quality & Best PracticesPositive aspects:
Suggestions:
🐛 Potential IssuesMinor concern:
🔒 Security ConcernsNone identified. The changes only affect logging and error messages with no security implications. ⚡ Performance ConsiderationsNone. String interpolation has negligible performance impact, and this code path only runs on connection close events. 🧪 Test CoverageObservation:
Recommendation:
📝 DocumentationThe changes are self-documenting through improved error messages. No additional documentation needed. Overall AssessmentRating: ✅ Approve with minor suggestion This is a good quality-of-life improvement for debugging. The only suggestion is to add null-safety for the |
Code ReviewThis PR makes two small but valuable improvements to error messaging and logging. Overall, the changes are good and improve debuggability. Positive Aspects
Code QualityTypeScript Change (actor-conn.ts):
Rust Change (lib.rs):
Test Coverage
Security Considerations
Performance Considerations
Suggestions
SummaryVerdict: Approve with minor suggestions The changes are solid improvements to debuggability. The only concern is the potential for awkward formatting with empty reason strings, but this is a minor issue that doesn't block the PR. Great work on improving error messages! |
Code ReviewThanks for this PR! The changes improve error messages by adding more context. Positive Aspects
ObservationsTypeScript Change (actor-conn.ts:534): The addition of close code and reason is helpful, but closeEvent.reason may be undefined in Node.js environments (as noted in comments on line 499-501). This could result in messages displaying undefined. Consider defensive handling to only include reason when it exists. Rust Change (lib.rs:672): The log message clarification is good and removes ambiguity. OverallThe changes improve debuggability. Minor suggestion: add defensive checks for undefined values in the TypeScript error message. Recommendation: Minor revision suggested for the TypeScript change to handle undefined values gracefully. |
|
Code Review Summary: This PR improves error messaging by adding close code and reason to disconnection errors in TypeScript, and clarifies a log message in Rust. Positive:
Issues:
Overall: Good improvement, but suggest handling potential undefined values for more robust error messages across different runtime environments. |
b6dfb0d to
31af31a
Compare

No description provided.