Skip to content

chore(deps): allow better-sqlite3 13 as a peer (0.5.1) - #32

Merged
rodrigobnogueira merged 2 commits into
mainfrom
chore/better-sqlite3-13-peer
Jul 31, 2026
Merged

chore(deps): allow better-sqlite3 13 as a peer (0.5.1)#32
rodrigobnogueira merged 2 commits into
mainfrom
chore/better-sqlite3-13-peer

Conversation

@rodrigobnogueira

Copy link
Copy Markdown
Contributor

Isolated major-version review: better-sqlite3 13

Widens the published peer range to ^11 || ^12 || ^13, matching nest-native/jobs#16 (released as 0.2.1). Both were needed: nest-native/reference-app#69 cannot install better-sqlite3 13 while either package's peer range rejects it (npm ERESOLVE).

What v13 actually changes

An N-API rewrite (prebuilt binaries ship with the package; prebuild-install is gone). The JavaScript surface is purely additivedb.explain() and statement.toString() added, nothing removed — plus a SqliteError cross-realm fix. Critically, SqliteError still carries the code the inbox's exactly-once dedup keys on: verified SQLITE_CONSTRAINT_UNIQUE on 13.0.2.

Verification (against 13.0.2, before widening)

  • Full suite: 135/135 pass · Coverage: 100% statements/branches/functions/lines
  • typecheck clean · release:check clean
  • Sample smokes: showcase (atomic outbox → in-process dispatch → exactly-once inbox) and Kafka (outbox → KafkaOutboxTransport → @KafkaConsumer → exactly-once inbox) both pass

Why widened, not moved

better-sqlite3 13 requires Node >=22; this package supports Node >=20. The devDependency therefore stays on 12.x — otherwise the Node-20 CI legs stop installing and a supported Node is silently dropped. A new CI leg (better-sqlite3 13 compatibility (Node 22)) installs 13 and runs the suite there, so both ends of the range are tested. The guidelines now record that rule.

This also means #29 (bumping the better-sqlite3 devDependency to 13) should be closed rather than merged — it would break the Node-20 legs.

Behaviorally unchanged, so a patch release: 0.5.1.

Isolated major-version review, matching the one done for @nest-native/jobs.
better-sqlite3 13 is an N-API rewrite: its JavaScript surface is purely
additive (db.explain(), statement.toString()) with no removals, and
SqliteError still carries the `code` the inbox's exactly-once dedup keys on
— verified SQLITE_CONSTRAINT_UNIQUE on 13.0.2. The full suite (135 tests),
100% coverage, typecheck, and both sample smokes (showcase + Kafka) pass
against 13.0.2.

The range is WIDENED, not moved: better-sqlite3 13 requires Node >=22 while
this package still supports Node >=20, so the devDependency stays on 12.x and
the Node-20 CI legs keep installing. A new CI leg installs 13 on Node 22 and
runs the suite there, so both ends of the published peer range are tested
rather than assumed; the guidelines record that rule.

Behaviorally unchanged — this only lets consumers on Node 22+ upgrade their
own better-sqlite3 without an npm ERESOLVE. Together with jobs 0.2.1 it
unblocks nest-native/reference-app#69.
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

📊 Coverage Coverage Report

Metric PR Base Diff
Statements ████████████████████ 2070/2070 (100%) 2070/2070 (100%) ⚪ 0%
Branches ████████████████████ 279/279 (100%) 279/279 (100%) ⚪ 0%
Functions ████████████████████ 88/88 (100%) 88/88 (100%) ⚪ 0%
Lines ████████████████████ 2070/2070 (100%) 2070/2070 (100%) ⚪ 0%

Updated for 149d3e1 | Compared against base branch

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

⏱️ Performance Report

✅ Tests 135 passed, 0 failed, 0 skipped
🧪 Suites 32
⏱️ Total step time 263.00s 🟢 -1.00s
⚙️ Test execution 255.34s 🟢 -867ms
🐢 Slowest test suites
# Suite Tests Duration vs Base
1 PostgresWakeListener 17 29.32s 🟢 -373ms
2 runWorkerLoop 13 23.26s 🔴 +561ms
3 OutboxClaimer (publish outcomes) 9 16.08s ⚪ ~0
4 WakeSocketServer + WakeSocketClient 9 15.84s 🔴 +276ms
5 KafkaInboxConsumer 8 13.89s ⚪ ~0
6 SqliteOutboxStore 8 13.79s 🟢 -184ms
7 OutboxWaker 7 12.73s 🔴 +712ms
8 MysqlOutboxStore 7 12.10s ⚪ ~0
9 InProcessOutboxTransport 5 8.79s 🔴 +117ms
10 SqliteInboxStore 5 8.48s 🟢 -276ms
🐌 Slowest individual tests
# Suite Test Duration vs Base
1 PostgresOutboxStore wakeChannel PostgresOutboxStore wakeChannel enqueue fires pg_notify on the configured channel (observed via LISTEN) 3.42s 🟢 -230ms
2 OutboxProducer (atomic enqueue) OutboxProducer (atomic enqueue) enqueue commits the outbox row with the business write 2.67s ⚪ ~0
3 OutboxProducer (atomic enqueue) OutboxProducer (atomic enqueue) a throw rolls back BOTH the outbox row and the business write 2.06s ⚪ ~0
4 OutboxClaimer (publish outcomes) OutboxClaimer (publish outcomes) tick publishes a pending row and marks it completed 1.95s 🟢 -96ms
5 WakeSocketServer + WakeSocketClient WakeSocketServer + WakeSocketClient a non-EADDRINUSE bind error is rethrown as-is 1.94s 🔴 +279ms
6 PostgresWakeListener PostgresWakeListener quotes a custom mixed-case channel (LISTEN must stay case-sensitive) 1.91s 🔴 +182ms
7 SqliteOutboxStore SqliteOutboxStore claimBatch does NOT reclaim a freshly claimed processing row 1.90s 🔴 +130ms
8 transport errors transport errors RetryableError carries name and optional delay 1.90s 🔴 +102ms
9 KafkaInboxConsumer KafkaInboxConsumer reads a Buffer message key 1.89s 🔴 +316ms
10 MysqlOutboxStore MysqlOutboxStore claimBatch marks candidates processing and returns the re-read rows 1.88s 🔴 +61ms
11 sqlite schema sqlite schema inbox_events: composite (source, message_key) unique index 1.88s 🔴 +87ms
12 OutboxWaker OutboxWaker notify() with a signal present still cleans up the abort listener 1.88s 🔴 +258ms
13 WakeSocketServer + WakeSocketClient WakeSocketServer + WakeSocketClient client notify() without onError still swallows the failure 1.87s ⚪ ~0
14 runWorkerLoop runWorkerLoop a throwing tick without onError still continues (onError is optional) 1.87s ⚪ ~0
15 PostgresOutboxStore PostgresOutboxStore markCompleted / retry / markFailed transition the row 1.87s ⚪ ~0

Updated for 149d3e1 | Compared against base branch

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

🧠 Cognitive Complexity Report

Metric PR Base Diff
Total complexity 79 79 ⚪ 0
Max function complexity 12 12 ⚪ 0
Functions measured 39 39 ⚪ 0
🧩 Most complex functions
Function Location Complexity Status
runWorkerLoop packages/messaging/outbox-worker.ts:34 12 🟢 OK
KafkaInboxConsumer.consume packages/messaging/adapters/kafka/kafka-inbox-consumer.ts:67 5 🟢 OK
PostgresWakeListener.#supervise packages/messaging/dialects/postgres/wake.ts:122 5 🟢 OK
WakeSocketServer.listen packages/messaging/wake-socket.ts:52 5 🟢 OK
OutboxClaimer.onPublishError packages/messaging/outbox-claimer.service.ts:84 4 🟢 OK
deriveDedupKey packages/messaging/wire-contract.ts:55 4 🟢 OK
MysqlInboxStore.runOnce packages/messaging/dialects/mysql/inbox-store.ts:43 3 🟢 OK
PostgresInboxStore.runOnce packages/messaging/dialects/postgres/inbox-store.ts:37 3 🟢 OK
SqliteInboxStore.runOnce packages/messaging/dialects/sqlite/inbox-store.ts:39 3 🟢 OK
KafkaInboxConsumer.readKey packages/messaging/adapters/kafka/kafka-inbox-consumer.ts:90 2 🟢 OK

🧭 Cognitive complexity is reported as a review signal, not a merge gate. Prefer small, intention-revealing refactors when complexity rises.


Updated for 149d3e1 | Compared against base branch

@rodrigobnogueira
rodrigobnogueira merged commit b6bacf9 into main Jul 31, 2026
8 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