Skip to content

Conversation

louwers
Copy link
Contributor

@louwers louwers commented Sep 10, 2025

This PR fixes the problem that static std::function variables are used to store callbacks. This causes problems when SQLite is used (also) used from a worker and can result in a crash.

This PR stack allocates the callbacks and passes it along to sqlite3changeset_apply via the context argument.

It also adds a regression test which crashes out before this change.

Lastly some functionality that is uses in test/parallel/test-sqlite.js is now also needed in test/parallel/test-sqlite-session.js so I factored that out to a different file.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Sep 10, 2025
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.29%. Comparing base (861d624) to head (d0dc60a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59848      +/-   ##
==========================================
+ Coverage   88.26%   88.29%   +0.02%     
==========================================
  Files         701      701              
  Lines      206774   206774              
  Branches    39778    39782       +4     
==========================================
+ Hits       182514   182570      +56     
+ Misses      16298    16228      -70     
- Partials     7962     7976      +14     
Files with missing lines Coverage Δ
src/node_sqlite.cc 81.47% <100.00%> (-0.06%) ⬇️

... and 47 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants