fix(db): bundle and verify the sql.js fallback - #9044
diegosouzapw merged 1 commit into
Conversation
|
Merged via local merge-train on 192.168.0.113 (32 cores) @ train tip Green: This was the first train of the day to run against a genuinely clean base — #9447 and #9392 had just taken the release back to green after 15 unit failures inherited from #9275 — so every red here was re-run in isolation on the exact train tip rather than assumed. All of them passed:
No failure was attributable to any boarded PR. For reference, |
7129106
into
diegosouzapw:release/v3.8.50
Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com>
What changed
require()calls so the standalone bundler emits real externals instead of missing-module stubssql.jsruntime, including its WASM asset, in standalone packagessql.jsadapter resolve its runtime from the installed package treecheck-pack-bootwith a forced-sql.jsround trip and a two-boot persistence check using the sameDATA_DIRRoot cause
The fallback path worked from source but was not a reliable packaged-runtime contract. Passing
requirethrough a loader callback prevented the bundler from seeing literal SQLite module specifiers, while the standalone assembly did not guarantee that the completesql.jsruntime was present. This could leave an installed package unable to recover when a native SQLite binding was unavailable.Impact
Packaged OmniRoute installations can safely preserve the existing driver cascade:
better-sqlite3node:sqlitebun:sqlitesql.jsThe pack-boot gate now verifies that the fallback can write settings, shut down cleanly, start again against the same database directory, and read the persisted value back.
Validation
release/v3.8.50: 34 passed, 0 failed, 1 skippedbetter-sqlite3preference probe in a scratch image without that native binding; cascade and fallback behavior remain covered/opt/omniroute/data/storage.sqlitePRAGMA quick_checkreturnedok; journal mode iswalsql.js/dist/sql-wasm.wasmis present in the installed runtimeNo Home topology or Model Identity changes are included in this PR.