Skip to content

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Feb 6, 2026

Description

This PR removes the unused waitForNames method from the QueueManager class and reorganizes imports across several files to improve code organization. It also fixes the Drizzle ORM exports by creating a new sqlite-core.ts file that re-exports specific functions from the Drizzle ORM package, rather than exporting everything directly.

Additionally, the PR updates the createFileSystemOrMemoryDriver function to accept an options object instead of separate parameters, making the API more flexible and consistent.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The changes have been tested with the existing test suite to ensure that the removal of the unused method and the reorganization of imports don't break any functionality.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@jog1t jog1t requested a review from NathanFlurry February 6, 2026 19:06
@jog1t jog1t marked this pull request as ready for review February 6, 2026 19:06
Copy link
Contributor Author

jog1t commented Feb 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add 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.

@claude
Copy link

claude bot commented Feb 6, 2026

Code Review: PR #4147 - fix: rivetkit build

Overview

This PR makes several changes to improve code organization and fix exports in the RivetKit TypeScript package. It also adds a complete Vercel-optimized version of the sandbox example.


Positive Changes

  1. New sqlite-core.ts export file - Good approach to control what's exported from Drizzle ORM rather than using wildcard exports. This provides better tree-shaking and clearer API surface.

  2. Import reorganization - Moving imports to the top of files improves code readability and follows standard conventions.

  3. Vercel example generation - The new sandbox-vercel example provides good coverage of RivetKit features in a deployment-ready format.


Issues & Concerns 🔴

1. Breaking API Change Without Clear Documentation

Location: rivetkit-typescript/packages/rivetkit/src/drivers/file-system/mod.ts

The PR changes createFileSystemOrMemoryDriver from accepting two separate parameters to accepting an options object. This is marked as a breaking change but there's no migration guide. The function signature still has persist as a positional parameter, which seems inconsistent with moving to an options pattern.

Recommendation: Either provide a migration guide or consider a non-breaking approach using function overloads.

2. Unused waitForNames Method Not Actually Removed

Location: rivetkit-typescript/packages/rivetkit/src/actor/instance/queue-manager.ts

The PR description states: removes the unused waitForNames method from the QueueManager class

However, looking at the file (lines 362-413), the waitForNames method is still present and fully implemented. This contradicts the PR description. Is this method actually unused? Should this be removed in a follow-up PR? Or is the PR description incorrect?

3. Potential Import Issues with Drizzle Exports

Location: rivetkit-typescript/packages/rivetkit/src/db/drizzle/sqlite-core.ts

The file has both a wildcard export AND specific named exports from the same module. This is redundant - the wildcard export already exports everything, so the specific exports below don't add value.

Recommendation: Either keep only the wildcard export, or remove it and keep only specific exports.

4. Code Duplication Between db/drizzle/mod.ts and db/mod.ts

Lines 59-82 in db/drizzle/mod.ts and lines 12-34 in db/mod.ts contain duplicate createActorKvStore functions.

Recommendation: Extract this to a shared utility function to follow DRY principles.

5. Missing Error Handling in Database Execute

Location: rivetkit-typescript/packages/rivetkit/src/db/drizzle/mod.ts:147-160

The executeSqlite function doesn't handle errors during query execution.

Recommendation: Add try-catch with proper error logging/rethrowing.

6. Large Generated Example Files in Git

The new sandbox-vercel example includes very large files (index.html: 787 lines, App.tsx: 981 lines, page-data.ts: 1090 lines). Are these hand-written or generated? If generated, should they be in .gitignore instead?


Minor Issues ⚠️

  1. Inconsistent null handling (line 97 in db/drizzle/mod.ts): The ternary is unnecessary, just use optional chaining
  2. Type safety: Several uses of any type reduce type safety. Consider using proper generic constraints.
  3. Import organization: Verify all files follow the pattern consistently

Testing Concerns 🧪

The PR description states tests were run, but:

  • No test file changes are included
  • The createFileSystemOrMemoryDriver API change should have corresponding test updates
  • Consider adding tests for the new sqlite-core.ts exports

Recommendations Summary

High Priority:

  1. Clarify/fix the waitForNames discrepancy in PR description vs actual code
  2. Address the breaking API change - provide migration guide or use function overloads
  3. Fix redundant exports in sqlite-core.ts
  4. Deduplicate createActorKvStore function

Medium Priority:
5. Add error handling in database execute functions
6. Reduce usage of any types
7. Clarify whether generated Vercel examples should be committed

Low Priority:
8. Add tests for API changes
9. Minor code simplifications


Verdict

The PR makes good progress on code organization, but has several issues that should be addressed before merging. The PR description doesn't match the actual changes (waitForNames), the breaking API change needs better documentation, code duplication should be eliminated, and the export structure in sqlite-core.ts should be fixed.

Recommendation: Request changes before merging.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2026

Graphite Automations

"Test" took an action on this PR • (02/06/26)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

Comment on lines 2 to +3
export { KEYS, makeConnKey } from "@/actor/instance/keys";
export type { ActorInstance, AnyActorInstance } from "@/actor/instance/mod";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The export statements need to be reordered according to the project's linting rules. The original order had the type exports for ActorInstance before the KEYS export.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@jog1t jog1t force-pushed the 02-06-fix_rivetkit_build branch from 28afd58 to cead745 Compare February 6, 2026 21:13
Comment on lines +2 to 6
import { getRequireFn } from "@/utils/node";
import type { Actions, ActorConfig } from "./config";
import type { ActionContextOf, ActorContext } from "./contexts";
import type { AnyDatabaseProvider } from "./database";
import type { ActorInstance } from "./instance/mod";
import { DeepMutable } from "@/utils";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statements need to be properly sorted according to the project's conventions. Ensure imports are grouped correctly (built-ins first, then external packages, then internal imports) and sorted alphabetically within groups.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 10, 2026

Merge activity

  • Feb 10, 8:45 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Feb 10, 8:46 AM UTC: CI is running for this pull request on a draft pull request (#4166) due to your merge queue CI optimization settings.
  • Feb 10, 8:48 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #4081.
  • Feb 10, 8:48 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #4081.

graphite-app bot pushed a commit that referenced this pull request Feb 10, 2026
# Description

This PR removes the unused `waitForNames` method from the `QueueManager` class and reorganizes imports across several files to improve code organization. It also fixes the Drizzle ORM exports by creating a new `sqlite-core.ts` file that re-exports specific functions from the Drizzle ORM package, rather than exporting everything directly.

Additionally, the PR updates the `createFileSystemOrMemoryDriver` function to accept an options object instead of separate parameters, making the API more flexible and consistent.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

The changes have been tested with the existing test suite to ensure that the removal of the unused method and the reorganization of imports don't break any functionality.

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant