fix(daemon): bump better-sqlite3 to ^12 and unpin Node 24 in CI - #1104
Merged
Conversation
better-sqlite3@11 aborts Node 24 processes with "Assertion failed: (env) != nullptr" in node::RemoveEnvironmentCleanupHook when Statement or Database finalizers run against a torn-down environment. That hits this package on two surfaces: - The daemon process itself: a restarted daemon can abort between binding its socket and sending its ready IPC message, so start() rejects with "Daemon failed to spawn ... exited null". On the Node 24 CI leg this failed the persistence tests (store pass-copy values, persist spawn and evaluation, rehydrated requests can be resolved after restart) with each crashed daemon's abort trace landing only in its endo.log. - The AVA worker: endo.test.js opens in-process Database handles via openTestDb for db-inspection assertions; their finalizers abort the test process at teardown, before AVA prints its failure summary (turbo then reports the task failed with exit 129 and no detail). Reproduced on Node 24.19.0, the CI toolchain version: the three restart tests failed 7 of 8 iterations with 11.10.0 and pass 8 of 8 with 12.11.1, which fixed the cleanup-hook lifecycle upstream. Node 22 is unaffected. No other workspace depends on better-sqlite3, so the lockfile drops 11.x entirely. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RuRefk7nt9vH96nfxcQcNP (cherry picked from commit a53d20e)
The matrix pinned Node to 24.18.0 because Node 24.19 triggers the better-sqlite3@11.10.0 legacy node::ObjectWrap cleanup abort (nodejs/node#65042). With @endo/daemon on better-sqlite3 ^12, which fixed the cleanup-hook lifecycle upstream, the pin is no longer needed; track the 24.x line again. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
This was referenced Sep 1, 2026
Closed
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.
Broken out of
feat/hosted-endo-management.Description
better-sqlite3@11uses the legacynode::ObjectWrapcleanup pattern; when itsDatabase/Statementfinalizers run after the Node environment is torn down,node::RemoveEnvironmentCleanupHookhitsAssertion failed: (env) != nullptrand aborts the process. Node 24.19 changed teardown ordering in a way that triggers this (nodejs/node#65042); 12.x fixed the cleanup-hook lifecycle upstream.CI already knows about this bug: the matrix is pinned to Node
24.18.0as a "temporary" workaround (a59021f8a). This PR takes the root fix instead — bump@endo/daemontobetter-sqlite3^12and un-pin all four matrix entries back to24.x. No other workspace depends on better-sqlite3, so the lockfile drops 11.x entirely.On the branch this was reproduced on Node 24.19.0: the daemon persistence/restart tests failed 7 of 8 iterations on 11.10.0 (a restarted daemon aborts between binding its socket and sending its ready IPC) and pass 8 of 8 on 12.11.1.
Security Considerations
None — a native dependency patch-level lifecycle fix; no API or authority changes.
Scaling Considerations
None.
Documentation Considerations
None; no user-visible behavior change.
Testing Considerations
Validated here:
@endo/daemonlint clean (0 errors, warning count identical tollmbaseline). The behavioral difference only manifests on Node ≥ 24.19, which CI's re-widened24.xlegs will now exercise.Compatibility Considerations
better-sqlite3 12 requires Node ≥ 20, which the repo already exceeds.
Upgrade Considerations
None; the SQLite file format is unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FnsnQttCNY3PwrtVqoE67s
Generated by Claude Code