Conversation
|
PR Review: chore: fix driver test suite This PR refactors the driver test suite and includes runtime fixes in the envoy client, native SQLite database bindings, and the dynamic isolate runtime. Bugs / Correctness Issues
File: rivetkit-typescript/packages/rivetkit-native/src/database.rs CLAUDE.md prohibits Mutex for shared containers. The lock is never held across an .await (only acquired inside spawn_blocking), so std::sync::Mutex is acceptable here. Without a comment explaining this, a future reader will flag it as a policy violation.
File: rivetkit-typescript/packages/rivetkit-native/src/database.rs as_ptr() uses .unwrap_or(ptr::null_mut()), silently returning null if the database is closed or mutex is poisoned. Any caller passing this pointer to raw SQLite C functions without a null check will trigger undefined behavior. Either remove as_ptr() from the public surface or document that callers must null-check the return value.
File: engine/packages/guard/src/routing/pegboard_gateway/resolve_actor_query.rs EMPTY_KEY is named for the empty-key sentinel but is reused as the join separator via escaped_parts.join(EMPTY_KEY). The naming is misleading. Consider renaming to KEY_SEPARATOR for the join, keeping EMPTY_KEY only for the early-return path.
File: rivetkit-typescript/packages/rivetkit-native/wrapper.js Number(bigint) loses precision for values outside Number.MAX_SAFE_INTEGER (2^53 - 1). SQLite INTEGER supports 64-bit signed integers and the Rust side accepts i64, so this silently truncates large values. Either throw for out-of-safe-range values or preserve full 64-bit precision across the boundary.
File: rivetkit-typescript/packages/rivetkit-native/wrapper.js When a caller passes a plain object as the binding but the SQL uses positional ? placeholders (valid SQLite), normalizeBindings throws "native sqlite object bindings require named placeholders". The check should fall through to positional binding when the SQL has no named params. Code Quality Issues
File: rivetkit-typescript/packages/rivetkit-native/src/database.rs execute_statement steps through rows but discards all SQLITE_ROW results, silently discarding results from INSERT ... RETURNING. The JS execute wrapper guards this in practice, but a comment explaining the limitation would prevent future misuse if execute_statement is called directly.
File: rivetkit-typescript/packages/rivetkit/dynamic-isolate-runtime/src/index.cts The module-level sqliteVfsPoolPromise singleton is reset to undefined in dynamicDisposeEnvelope. If loadSqliteVfsPool is called after disposal, a new pool will be created post-dispose. Consider guarding with a disposed flag that permanently blocks re-initialization. Convention Violations
Several error paths use console.error for runtime errors. These are pre-existing but the PR converts these callbacks to async functions. CLAUDE.md requires structured logging rather than console.error for observable runtime errors. Minor / Nits
Summary
|
1919c35 to
7283250
Compare
d52f9f7 to
e629058
Compare
7283250 to
5c3dbdf
Compare
e629058 to
ec89f2e
Compare
5c3dbdf to
5037448
Compare
5037448 to
ffdf968
Compare
4bea0d4 to
ac386ed
Compare
ffdf968 to
9b6c03d
Compare
9b6c03d to
7319f2d
Compare
7319f2d to
8a1d3a0
Compare
d7b0668 to
5dba5de
Compare
8a1d3a0 to
a84fd3d
Compare
a84fd3d to
124d6d9
Compare
124d6d9 to
c84f9db
Compare
c84f9db to
ab96a82
Compare
ab96a82 to
91a3a2b
Compare
91a3a2b to
ab96a82
Compare
ab96a82 to
56f7599
Compare
56f7599 to
ea36259
Compare
Merge activity
|

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: