-
Notifications
You must be signed in to change notification settings - Fork 142
fix(rivetkit): save alarm timeout per actor #3810
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.
2 Skipped Deployments
|
|
🚅 Deployed to the rivet-pr-3810 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. |
Merge activity
|
Code Review - PR #3810: fix(rivetkit): save alarm timeout per actorSummaryThis PR fixes a critical bug where alarm timeouts were shared across all actors in the ✅ Positive FeedbackCritical Bug Fix: This change correctly addresses a race condition where multiple actors would overwrite each other's alarm timeouts. The previous implementation stored
Clean Implementation: The fix properly:
🔍 Code Quality ObservationsMinor: Whitespace Changes (lines 155, 360) // Before: onDisconnected: (_code, _reason) => {},
// After: onDisconnected: (_code, _reason) => { },According to 🧪 Test Coverage ConcernsMissing Test Coverage: There are no automated tests covering the multi-actor alarm scenario. I found tests in Suggested Test Case: // Test: Multiple actors should maintain independent alarm timeouts
test('multiple actors with independent alarms', async () => {
const actor1 = await createActor('test-actor-1');
const actor2 = await createActor('test-actor-2');
// Set alarms at different times
await actor1.setAlarm(Date.now() + 1000);
await actor2.setAlarm(Date.now() + 2000);
// Verify both alarms fire independently
// ...
});🛡️ Security & PerformanceNo concerns identified:
📊 Architectural CorrectnessThe fix aligns well with the existing architecture:
✨ Recommendations
🎯 VerdictApproved ✅ - This is a solid bug fix that correctly addresses a critical issue with alarm timeout management. The implementation is clean and follows existing patterns. The whitespace changes are minor nitpicks that don't affect functionality. Great catch on this bug! The previous implementation would have caused serious issues in production with multiple actors. Review generated by Claude Code |
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: |

No description provided.