-
Notifications
You must be signed in to change notification settings - Fork 146
chore(rivetkit): update cloudflare workers and nextjs to latest #3803
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(rivetkit): update cloudflare workers and nextjs to latest #3803
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
🚅 Deployed to the rivet-pr-3803 environment in rivet-frontend
|
PR Review: Cloudflare Workers and Next.js Package UpdatesThis PR updates Cloudflare Workers and Next.js packages. Here is my comprehensive analysis: CRITICAL ISSUES1. Race Condition in Actor Loading (actor-driver.ts:147-156)
2. Memory Leak in Global DO State (actor-driver.ts:31-47)
3. Stale State in Generation Resurrection (actor-handler-do.ts:327-329)
HIGH-SEVERITY ISSUES4. Missing Error Handling (actor-driver.ts:308-311)
5. Type Safety Issue (actor-kv.ts:51-62)
6. SQL Performance (actor-kv.ts:30-48)
MEDIUM-SEVERITY ISSUES7. JSON Serialization (actor-handler-do.ts:380-385) - No error handling for non-serializable data 8. Dead Code (next-js/src/mod.ts:55-56) - Hardcoded false instead of NODE_ENV check 9. File Watcher Timeout (next-js/src/mod.ts:192) - Memory leak if stream never finishes 10. Stream Error Logging (next-js/src/mod.ts:218-220) - Missing error details BREAKING CHANGESGeneration Tracking: Actor IDs changed from {doId} to {doId}:{generation} Impact:
Recommendation: Add migration guide POSITIVE NOTES
RECOMMENDATIONSBefore Merge:
Post-Merge:
SUMMARY
Overall: Good architectural improvements with generation tracking, but critical race conditions and memory management issues need addressing before production. Review by Claude Code |
b5dedb8 to
16a5dd9
Compare
16a5dd9 to
f05e54a
Compare
f05e54a to
903dd6e
Compare
903dd6e to
fc02439
Compare
fc02439 to
2f552e9
Compare
db239d2 to
588ff34
Compare
588ff34 to
80f64c3
Compare
71a96c6 to
0f89527
Compare
80f64c3 to
b29a4f5
Compare
0f89527 to
9c5ca61
Compare
9c5ca61 to
ed7fd2b
Compare
ed7fd2b to
7786867
Compare
b29a4f5 to
fe6e069
Compare
fe6e069 to
9cf31ec
Compare
Pull Request Review: Update Cloudflare Workers and Next.js to LatestThis PR re-enables previously commented-out code for Cloudflare Workers and Next.js integrations, updates the architecture to use a new Runtime class, and fixes several integration issues. Overall, this is a solid refactoring with improved structure. StrengthsArchitecture Improvements
Bug Fixes
Issues and Recommendations1. Security: SQL Injection Risk (High Priority)Location: rivetkit-typescript/packages/cloudflare-workers/src/actor-driver.ts:301 While WHERE 1=1 works, its an anti-pattern that could be dangerous if this code is copy-pasted elsewhere with dynamic values. Recommendation: Omit the WHERE clause entirely or use WHERE true 2. Race Condition: Actor Destruction (Medium Priority)Location: rivetkit-typescript/packages/cloudflare-workers/src/actor-driver.ts:287 callOnStopAsync is called without awaiting and theres no error handling. If actor.onStop throws, the error will be silently swallowed. Recommendation: Add error handling with catch block 3. Potential Memory Leak (Medium Priority)Location: rivetkit-typescript/packages/cloudflare-workers/src/actor-driver.ts:33 The dos Map grows unbounded and never removes entries, even after actors are destroyed. Over time, this could lead to memory leaks. Recommendation: Clean up the Map entry when an actor is destroyed 4. File Watcher Still Disabled (Low Priority)Location: rivetkit-typescript/packages/next-js/src/mod.ts:56 The file watcher for hot-reload detection is hardcoded to false. This feature is completely disabled with dead code. Recommendation: Either remove the dead code entirely or add an environment variable to enable it for debugging 5. Testing GapThis PR re-enables significant functionality but doesnt include new tests or update existing tests to verify the changes work correctly. Recommendation: Add integration tests for:
Minor IssuesCode Style
DocumentationTODOs left unaddressed - consider creating follow-up issues to track these Security Assessment
Performance Considerations
Dependencies
SummaryThis PR makes good architectural improvements, particularly the Runtime class extraction and simplified driver constructors. However, there are a few issues that should be addressed: Must Fix Before Merge:
Should Fix:
Nice to Have:
Overall: Approve with changes - The core refactoring is sound, but the memory leak and error handling issues should be fixed before merging. |
Merge activity
|

No description provided.