fix: add cold-restart native-driver regression check to electron smoke (#7592) - #10921
Merged
Merged
Conversation
#7592) The stale-ABI better-sqlite3 root cause itself is already fixed on this tip (#6605, #7353); the issue stayed open only because scripts/dev/smoke-electron-packaged.mjs never launched the packaged app twice against a persisted DATA_DIR nor asserted which SQLite driver loaded. Add an ELECTRON_SMOKE_COLD_RESTART mode that relaunches against the same DATA_DIR and asserts the startup log shows a native driver (bun:sqlite/better-sqlite3/ node:sqlite), not the sql.js WASM fallback, and wire it blocking into the Linux leg of electron-release.yml.
backryun
added a commit
to backryun/OmniRoute
that referenced
this pull request
Aug 21, 2026
The rebase onto c130f2a dropped the env-doc pair that the pre-rebase merge commit carried. Restores it: .env.example entry + ENVIRONMENT.md row for the cold-restart native-driver smoke check.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
diegosouzapw#7592) (diegosouzapw#10921) Validado no worktree combinado: typecheck:core, changelog-integrity, file-size, lint e 7/7 testes focados passando. Investigação completa com verificação de ancestralidade via merge-base antes de fechar a issue original. CI vermelho é o base-red já rastreado em diegosouzapw#9985.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #7592
Root cause (verified at current tip)
The original theory in #7592 (better-sqlite3 shipped inside app.asar) was
refuted — better-sqlite3 ships via
extraResources, never insideapp.asar.The real mechanism the reporters converged on — a Turbopack-hashed
better-sqlite3-<hash>import resolving a stale Node-ABI binary instead ofthe canonical Electron-ABI one — is already fixed on this tip:
main): Electron 42→43, rebuildbetter-sqlite3fromsource at ABI 148.
release/v3.8.49): normalize Turbopack-hashedstandalone externals so
better-sqlite3-<hash>resolves to the canonicalpackage.
Both merge commits are confirmed ancestors of the current tip via
git merge-base --is-ancestor. The sql.js OOM/retry-loop compounding issue isalso capped (#6835/#6628/#6632).
The issue stayed open only because the regression test was missing: a
community reporter's own investigation on the issue thread independently
reached the same conclusion and explicitly flagged that
scripts/dev/smoke-electron-packaged.mjsnever exercises a packaged app'ssecond launch against an existing DB, and never asserts which SQLite
driver loaded.
What this PR does (test-only, no production code change)
scripts/dev/smoke-electron-packaged.mjs: extract the launch/wait/settlelogic into
launchAndCollectLogs()and add anELECTRON_SMOKE_COLD_RESTART=1mode that relaunches the packaged appagainst the same, persisted
DATA_DIRand asserts (new exportedassertNativeDriverSelected()) that the startup log shows a native driver(
bun:sqlite/better-sqlite3/node:sqlite) selected, not the sql.js(WASM) fallback.
.github/workflows/electron-release.yml: wireELECTRON_SMOKE_COLD_RESTART=1into the Linux smoke leg (blocking — Linux has no Windows-specific sandbox
caveats), while leaving the Windows leg as-is per the existing
continue-on-errorcomment.tests/unit/electron-smoke-script.test.ts: unit tests forassertNativeDriverSelected()covering all three native drivers, thesql.js-fallback failure case, and the missing-driver-line failure case.
Validation
This is analyzed/implemented per the triage plan-file's
needs-vpsverdict —a full electron-builder packaged run (native rebuild + code-signing, ~GB
output) is out of scope for this sandbox, so the new orchestration logic
(
launchAndCollectLogs, cold-restart wiring) is not exercised end-to-endhere. What is verified locally:
node --import tsx/esm --test tests/unit/electron-smoke-script.test.ts—7/7 passing, including the 3 new
assertNativeDriverSelectedcases (nativedriver accepted, sql.js fallback flagged, missing driver line flagged).
node --check scripts/dev/smoke-electron-packaged.mjs— syntax OK.npm run typecheck:core— clean.npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>— clean.node scripts/check/check-file-size.mjs— OK (script isn't in the scanned dirs; no regression).node scripts/check/check-complexity.mjs/check-cognitive-complexity.mjs— both OK, ratchet improved (no new violations).node scripts/check/check-changelog-integrity.mjs— OK.The actual two-launch-with-driver-assertion path will get its first real
exercise on the Linux leg of
electron-release.yml(xvfb-run, packagedbuild) the next time that workflow runs — recommend tracking CI results there
before closing #7592 outright.
Citations
_tasks/pipeline/bugs/2-implementing/7592-better-sqlite3-asar-unpack-sqljs-oom.plan.md