Skip to content

fix: add cold-restart native-driver regression check to electron smoke (#7592) - #10921

Merged
diegosouzapw merged 1 commit into
release/v3.8.50from
fix/7592-sqlite3-asar-oom
Aug 21, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.50from
fix/7592-sqlite3-asar-oom

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

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 inside app.asar.
The real mechanism the reporters converged on — a Turbopack-hashed
better-sqlite3-<hash> import resolving a stale Node-ABI binary instead of
the canonical Electron-ABI one — is already fixed on this tip:

Both merge commits are confirmed ancestors of the current tip via
git merge-base --is-ancestor. The sql.js OOM/retry-loop compounding issue is
also 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.mjs never exercises a packaged app's
second 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/settle
    logic into launchAndCollectLogs() and add an
    ELECTRON_SMOKE_COLD_RESTART=1 mode that relaunches the packaged app
    against the same, persisted DATA_DIR and asserts (new exported
    assertNativeDriverSelected()) 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: wire ELECTRON_SMOKE_COLD_RESTART=1
    into the Linux smoke leg (blocking — Linux has no Windows-specific sandbox
    caveats), while leaving the Windows leg as-is per the existing
    continue-on-error comment.
  • tests/unit/electron-smoke-script.test.ts: unit tests for
    assertNativeDriverSelected() covering all three native drivers, the
    sql.js-fallback failure case, and the missing-driver-line failure case.

Validation

This is analyzed/implemented per the triage plan-file's needs-vps verdict —
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-end
here. What is verified locally:

  • node --import tsx/esm --test tests/unit/electron-smoke-script.test.ts —
    7/7 passing, including the 3 new assertNativeDriverSelected cases (native
    driver 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, packaged
build) the next time that workflow runs — recommend tracking CI results there
before closing #7592 outright.

Citations

#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.
@diegosouzapw diegosouzapw added the hold-vps PR verde, merge aguardando validação live (release-drain) label Aug 21, 2026
@diegosouzapw
diegosouzapw merged commit a8ca957 into release/v3.8.50 Aug 21, 2026
11 checks passed
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.
@diegosouzapw
diegosouzapw deleted the fix/7592-sqlite3-asar-oom branch August 21, 2026 15:33
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold-vps PR verde, merge aguardando validação live (release-drain)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants