Skip to content

test runtime: tests reaching a read-only SQLite open run on Node (orca #48, slice 3) - #51

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-sqlite-bun-rest
Nov 15, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-sqlite-bun-rest

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

Refs #48 (slice 3: the remaining tests that reach SQLite through product code and run on Bun; 5 red files). #48 stays open for the rest.

Root cause

The same as slice 1 (PR 49): Bun's macOS SQLite refuses a read-only open of a closed WAL database ("unable to open database file"); Node opens it. The import scan (vitest-sqlite-runtime-scan.mjs) routes a test to Node only when it imports a module listed in SQLITE_MODULES, and these read-only openers were not listed:

Module Why it is listed now
src/main/sqlite/row-cache/keyed-json-row-cache the read-only opener itself (KeyedJsonRowCache, line 137)
src/main/runtime/push/notifications/mobile-notification-dismissal-store reads through KeyedJsonRowCache
src/main/runtime/push/notifications/runtime-mobile-notification-controller the notification IPC tests import it; it owns the dismissal store
src/main/persistence/profile-state/profile-state-database opens the profile state read-only (lines 89, 156)

The red files this fixes (each passed on Node and failed on Bun every run)

  • src/main/ipc/notifications-subject-retirement.test.ts
  • src/main/ipc/notifications-external-acknowledgement.test.ts
  • src/main/runtime/push/notifications/mobile-notification-dismissal-store.test.ts
  • src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts
  • tests/e2e/helpers/persisted-profile-state.unit.test.ts

Reach

16 tests move to Node: the 5 above, and 11 more that import the same modules. Those passed on Bun only because they never re-read a closed file. All of them now run on Node, as production does. Product code is unchanged.

Tests

  • vitest-node-runtime-files.test.mjs gets a slice 3 case for the five files. Red first (all 5 on Bun), green now.
  • The 16 moved tests + the routing test, through the normal runner: 98 passed, 0 failed (1 skipped).
  • Preflight check-changed: 13/13.

…#48, slice 3)

Same root cause as slice 1 (PR 49), reached through other product
modules: Bun's macOS SQLite refuses a read-only open of a closed WAL
database ("unable to open database file"); Node opens it. The import
scan routes a test to Node only when it imports a module in
SQLITE_MODULES, and these modules were not there:

- src/main/sqlite/row-cache/keyed-json-row-cache: the read-only opener
  itself (KeyedJsonRowCache, line 137).
- src/main/runtime/push/notifications/mobile-notification-dismissal-store
  and runtime-mobile-notification-controller: the dismissal store reads
  through KeyedJsonRowCache; the notification IPC tests import the
  controller.
- src/main/persistence/profile-state/profile-state-database: opens the
  profile state read-only (lines 89, 156).

Red before (each passes on Node, fails on Bun every run):
ipc/notifications-subject-retirement, ipc/notifications-external-
acknowledgement, push mobile-notification-dismissal-store and
-read-failure, tests/e2e/helpers/persisted-profile-state.

Reach: 16 tests move to Node: the 5 above and 11 that import the same
modules (they passed on Bun only because they never re-read a closed
file). All run on Node as production does. No product code changes.

Test: vitest-node-runtime-files.test.mjs gets a slice 3 case for the
five files; red first (5 of 5 on Bun), green now.

Evidence: the 16 moved tests + the routing test through the normal
runner: 98 passed, 0 failed (1 skipped).

Refs #48
@nachumi-a2zoperations
nachumi-a2zoperations merged commit 6bffcd1 into blowzer/fork-only Nov 15, 2026
2 checks passed
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