-
Notifications
You must be signed in to change notification settings - Fork 146
chore(engine): provide detailed error for invalid serverless sse event #3881
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
chore(engine): provide detailed error for invalid serverless sse event #3881
Conversation
|
🚅 Deployed to the rivet-pr-3881 environment in rivet-frontend
|
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: Improved Serverless SSE Error HandlingOverviewThis PR consolidates the error handling for serverless SSE events by:
Positive Changes ✅1. Better Error Reporting
2. Code Organization
3. Handling Edge Cases
Issues & Recommendations 🔧1. CRITICAL: Breaking Change - Test Must Be UpdatedThe test at rivet_types::actor::RunnerPoolError::ServerlessInvalidPayload { message } => { ... }
rivet_types::actor::RunnerPoolError::ServerlessInvalidBase64 => { ... }This needs to be updated to: rivet_types::actor::RunnerPoolError::ServerlessInvalidSsePayload { message, raw_payload } => {
tracing::info!(?message, ?raw_payload, "got ServerlessInvalidSsePayload as expected");
}Action Required: Update the test before merging, or verify tests are passing in CI. 2. Documentation Out of Date
- `ServerlessInvalidBase64` - Invalid base64 in SSE message
- `ServerlessInvalidPayload` - Invalid protocol payloadShould be updated to: - `ServerlessInvalidSsePayload` - Invalid SSE payload (base64 or protocol deserialization error)3. SDK Regeneration RequiredThe grep results show that the old error types are embedded in generated SDKs:
Action Required: Regenerate SDKs to include the new 4. Minor: Incomplete Logging ContextAt line 659, when logging unknown event types: tracing::warn!(event, "received unknown serverless sse message event kind");Consider adding more context: tracing::warn!(event, ?msg, "received unknown serverless sse message event kind");This would help debugging by showing the full message, not just the event type string. 5. Code Style: Match Arms ConsistencyThe refactored code at lines 327-336 has inconsistent indentation. The nested Current: match payload {
protocol::mk2::ToServerlessServer::ToServerlessServerInit(init) => {
if runner_id.is_none() {
runner_id = Some(...);
// ...
}
}
}This is fine, but note that in // Only initialize the runner once
if runner_id.is_none() {Performance Considerations ⚡Positive:
Security Considerations 🔒Positive:
Note: The raw payload could contain sensitive information. Consider whether this data should be logged or included in error responses. Since it is only included on error and truncated, the current approach seems reasonable. Test Coverage 📊Action Required:
SummaryThis is a solid refactoring that improves error handling and debuggability. However, there are blocking issues that must be addressed:
Once these are addressed, this PR will be ready to merge. Checklist for Author
|
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
6e8950e to
8e7fba5
Compare
8e7fba5 to
41511a3
Compare
Merge activity
|

No description provided.