-
Notifications
You must be signed in to change notification settings - Fork 33
fix(studio): allow replacing the whole state, catch unhandled promises #1122
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
fix(studio): allow replacing the whole state, catch unhandled promises #1122
Conversation
Claude finished @jog1t's task —— View job PR Review: fix(studio): allow replacing the whole state, catch unhandled promisesReview Checklist:
OverviewThis PR introduces two main improvements:
Detailed Review✅ Code Quality & Best PracticesGood practices observed:
Areas for improvement:
✅ Bug Fixes & ImprovementsFixed Issues:
New Functionality:
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
@rivetkit/actor
@rivetkit/core
@rivetkit/db
rivetkit
@rivetkit/cloudflare-workers
@rivetkit/redis
@rivetkit/framework-base
@rivetkit/react
commit: |
Merge activity
|
#1122) ### TL;DR Removed database dependencies from the counter example and simplified the actor state structure. ### What changed? - Removed database integration from the counter example: - Deleted `dizzle.config.ts` and `schema.ts` files - Removed database-related dependencies from `package.json` (drizzle-orm, better-sqlite3, drizzle-kit) - Removed `@rivetkit/db` dependency - Simplified the counter example's actor state to only include the essential `count` property - Removed the database initialization and unused code in the registry - Updated the file system global state implementation to improve actor state loading - Enhanced the inspector API to support both patching and replacing state - Updated Zod import to use v4 - Added error handling for actor fetching in the manager inspector ### How to test? 1. Run the counter example to verify it works without database dependencies: ``` cd examples/counter pnpm install pnpm start ``` 2. Test the inspector API's new state replacement functionality by making a PATCH request with a `replace` property 3. Verify that actor state loading works correctly with the updated implementation ### Why make this change? This change simplifies the counter example by removing unnecessary database dependencies, making it more focused on demonstrating the core actor functionality. It also improves the state management implementation and enhances the inspector API with better error handling and the ability to completely replace state, providing more flexibility for debugging and development.
TL;DR
Removed database dependencies from the counter example and simplified the actor state structure.
What changed?
dizzle.config.ts
andschema.ts
filespackage.json
(drizzle-orm, better-sqlite3, drizzle-kit)@rivetkit/db
dependencycount
propertyHow to test?
replace
propertyWhy make this change?
This change simplifies the counter example by removing unnecessary database dependencies, making it more focused on demonstrating the core actor functionality. It also improves the state management implementation and enhances the inspector API with better error handling and the ability to completely replace state, providing more flexibility for debugging and development.