Skip to content

fix(rivetkit): route all actor sqlite through envoy when local sqlite is not compiled#5473

Merged
abcxff merged 1 commit into
mainfrom
stack/fix-rivetkit-route-all-actor-sqlite-through-envoy-when-local-sqlite-is-not-compiled-pppnpqnl
Jul 23, 2026
Merged

fix(rivetkit): route all actor sqlite through envoy when local sqlite is not compiled#5473
abcxff merged 1 commit into
mainfrom
stack/fix-rivetkit-route-all-actor-sqlite-through-envoy-when-local-sqlite-is-not-compiled-pppnpqnl

Conversation

@abcxff

@abcxff abcxff commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@abcxff

abcxff commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Stack for rivet-dev/rivet

Get stack: forklift get 5473
Push local edits: forklift submit
Merge when ready: forklift merge 5473

change pppnpqnl

@railway-app
railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5473 July 23, 2026 18:45 Destroyed
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review

Summary: Fixes a real bug. build_actor_context (rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:1199) constructs a SqliteDb unconditionally for every actor via SqliteDb::new_with_remote_sqlite(...), since internal state/KV/queue storage always uses SQLite regardless of whether the actor declares a user database. select_sqlite_backend (rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:953) returns SqliteRuntimeError::Unavailable when remote_sqlite is false and the sqlite-local feature is not compiled in. The old guard, A::HAS_DATABASE && !cfg!(feature = "sqlite-local"), only forced remote_sqlite = true for actors that declared a database, so any actor without a declared database would fail to construct its SqliteDb (and thus fail to start) whenever sqlite-local was not compiled. Since rivetkits default feature set is sqlite (remote-only, rivetkit-rust/packages/rivetkit/Cargo.toml:13), this affected the default build, not just some opt-in configuration.

Correctness: The fix (dropping the A::HAS_DATABASE && clause) is minimal and correct. config.remote_sqlite = true is only ever set, never cleared, so it is monotonic with respect to any remote_sqlite: true a caller may have already set on the passed-in ActorConfig.

Test coverage: The updated test splits assertions with #[cfg(feature = "sqlite-local")] / #[cfg(not(feature = "sqlite-local"))] to check both build configurations correctly. Since the default feature set excludes sqlite-local, the not(sqlite-local) branch, the one that was actually broken, now runs under a plain cargo test -p rivetkit, so this regression would be caught by default CI without needing a special feature flag invocation.

Style: Comments are complete sentences explaining the non-obvious "why" per CLAUDE.md conventions. Scope is appropriately narrow: this only touches rivetkit (Rust) config resolution and does not need mirroring to TypeScript/NAPI, which compute remote_sqlite through a separate ActorConfigInput path unaffected by this bug.

No bugs, security, or performance concerns found in this change.

@railway-app

railway-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-5473 environment in rivet-frontend

Service Status Web Updated (UTC)
kitchen-sink 😴 Sleeping (View Logs) Web Jul 23, 2026 at 6:56 pm
frontend-cloud 😴 Sleeping (View Logs) Web Jul 23, 2026 at 6:55 pm
website 😴 Sleeping (View Logs) Web Jul 23, 2026 at 6:53 pm
frontend-inspector 😴 Sleeping (View Logs) Web Jul 23, 2026 at 6:53 pm
ladle ✅ Success (View Logs) Web Jul 23, 2026 at 6:47 pm
mcp-hub ✅ Success (View Logs) Web Jul 23, 2026 at 6:45 pm

@abcxff
abcxff force-pushed the stack/fix-rivetkit-route-all-actor-sqlite-through-envoy-when-local-sqlite-is-not-compiled-pppnpqnl branch from 0cdbf72 to 0931599 Compare July 23, 2026 19:47
@abcxff
abcxff merged commit 0931599 into main Jul 23, 2026
12 of 16 checks passed
@abcxff
abcxff deleted the stack/fix-rivetkit-route-all-actor-sqlite-through-envoy-when-local-sqlite-is-not-compiled-pppnpqnl branch July 23, 2026 19:48
@railway-app
railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5473 July 23, 2026 19:48 Destroyed
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