Update better-sqlite3 to v12.4.4 for Node.js 24 support#230
Open
IanMayo wants to merge 8 commits intothevahidal:mainfrom
Open
Update better-sqlite3 to v12.4.4 for Node.js 24 support#230IanMayo wants to merge 8 commits intothevahidal:mainfrom
IanMayo wants to merge 8 commits intothevahidal:mainfrom
Conversation
- Upgrade better-sqlite3 from ^8.1.0 to ^12.4.1 - Enables Node.js 24 compatibility - better-sqlite3 v12.x supports Node.js 20, 22, 23, and 24 - No breaking API changes affecting soul-cli functionality Fixes compatibility issues when running on Node.js 24.
8 tasks
Add AUTH, TOKEN_SECRET, and initial user credentials to test script so auth-related tests can run properly. Add --forceExit for clean exit.
Prevents the setInterval from blocking process exit during tests.
Handle SQLITE_CONSTRAINT_UNIQUE error when default role already exists, which can occur when Jest workers share the test database but have separate module caches.
thevahidal
requested changes
Dec 6, 2025
Owner
There was a problem hiding this comment.
Thanks for the PR @IanMayo, I left some comments for you.
package.json
Outdated
Owner
There was a problem hiding this comment.
Please bump the Soul version as well
Collaborator
Author
There was a problem hiding this comment.
BTW - I haven't forgotten this PR @thevahidal , but I started a new job in December, and it has stolen my Open Source contribution time. Hopefully things will settle down soon enough for me to fix these bits :-D
| if (e.code !== 'SQLITE_CONSTRAINT_UNIQUE') { | ||
| throw e; | ||
| } | ||
| // role already exists, ignore |
Owner
There was a problem hiding this comment.
It the role already exists, shouldn't we get it from db?
// role already exists, ignore
roleId = rowService...| "cli": "nodemon src/server.js --database foobar.db", | ||
| "swagger-autogen": "cross-env NO_CLI=true node src/swagger/index.js", | ||
| "test": "cross-env CI=true NODE_ENV=test NO_CLI=true DB=test.db CORE_PORT=8001 jest --testTimeout=10000", | ||
| "test": "cross-env CI=true NODE_ENV=test NO_CLI=true DB=test.db CORE_PORT=8001 AUTH=true TOKEN_SECRET=test-secret INITIAL_USER_USERNAME=admin INITIAL_USER_PASSWORD=Admin123#Test jest --testTimeout=10000 --forceExit", |
Owner
There was a problem hiding this comment.
For now it's ok but in the future we need to check why we need --forceExit and fix any related issues.
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.
Fixes compatibility issues when running on Node.js 24.
Test verification: