openvibers/openvibe.sdk Commits

createTestDb's pg lease no longer keeps a test process alive; release 0.31.1 (#15)

OP OpenVibers committed 5 Oct 2026 · 5c53d69b63 · 8 files, +20 −9

* createTestDb's pg lease no longer keeps a test process alive; release 0.31.1

Since 0.26 createTestDb (pg mode) opens a lease pg.Client to hold the run's advisory lock. Its ref'd socket kept a finished test file's process alive, so per-file runners timed out every file that ends without process.exit() (OpenVibe.Media's test:pg hung at 300 s per file after its bump to 0.28). The lease socket is unref'd right after it connects; the lock still holds while the process lives and close() releases it.

* Regenerate the browser bundle for 0.31.1

Changes

ddiff --git a/CHANGELOG.md b/CHANGELOG.md
iindex 72cee91..9ff1816 100644
---- a/CHANGELOG.md
++++ b/CHANGELOG.md
@@@ -7,6 +7,14 @@ release may change an API and says so here.
++## 0.31.1 (2026-10-05)
++
++- **`createTestDb` in pg mode no longer keeps a test process alive (`openvibe-sdk/testing`, patch):** the lease
++ `pg.Client` it opens to hold the run's advisory lock (since 0.26) kept a ref'd socket, so a test file that finished
++ without `process.exit()` never exited and a per-file runner timed it out (Media's test:pg hung at 300 s per file).
++ The lease socket is now unref'd right after it connects; the lock still holds for as long as the process lives, and
++ `close()` still releases it.
++
## 0.31.0 (2026-10-05)
- **`openvibe-sdk/service` carries the HTTP telemetry middleware and autoscaling signals (plan T1):** lifted from
ddiff --git a/README.md b/README.md
iindex e67406f..1f1bb88 100644
---- a/README.md
++++ b/README.md
@@@ -2,14 +2,14 @@
> Supported browser and server clients for the OpenVibe platform.
--**Status:** alpha, v0.31.0 (roadmap Wave 2; developer apps from Wave 20; Media objects v2 from Wave 4; the Tools platform API; Search, Chat and AI clients from WS-F task 4; per-actor limits from WS-R task 4). Every release is tagged (see [CHANGELOG.md](CHANGELOG.md)). Tested against local stub servers and the built-in mock platform only, never against the live platform. Services pin release tags; each repository's `STATUS.json` names the one it uses.
++**Status:** alpha, v0.31.1 (roadmap Wave 2; developer apps from Wave 20; Media objects v2 from Wave 4; the Tools platform API; Search, Chat and AI clients from WS-F task 4; per-actor limits from WS-R task 4). Every release is tagged (see [CHANGELOG.md](CHANGELOG.md)). Tested against local stub servers and the built-in mock platform only, never against the live platform. Services pin release tags; each repository's `STATUS.json` names the one it uses.
**Plan:** OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30.
**License:** MIT ([LICENSE](LICENSE)). This package is a library that apps outside the network embed, so it uses MIT. The OpenVibe services themselves stay AGPL-3.0.
**If a capability is not in the SDK, it is not public.** Apps call services through `openvibe-sdk` and never build internal routes themselves. A route with no SDK wrapper is internal, even when you can reach it, and it can change without notice. To make a capability public, first define it in OpenVibe.Contracts, then wrap it here.
```bash
--npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.31.0
++npm install https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.31.1
```
It has no runtime dependencies. It needs Node ≥ 20, or any browser with `fetch`, Web Crypto and `TextDecoder`. There is no build step. The package is CommonJS with ESM entry points (`import` works). Each subpath has its own `.d.ts`. For a page with no bundler, `browser/openvibe-sdk.mjs` is one self-contained ES module of the browser-safe subpaths (see [Browser without a bundler](#browser-without-a-bundler)). It does not depend on `openvibe-contracts` at runtime: it copies the contract types it uses (from Contracts v0.86.0, a devDependency the tests check them against).
ddiff --git a/STATUS.json b/STATUS.json
iindex 80893b8..ec3a44a 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -3,7 +3,7 @@
"stage": "alpha",
"code": true,
"wave": "W2",
-- "version": "0.31.0",
++ "version": "0.31.1",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026), §3.2; roadmap §30",
"deployed": false,
"deployment": "none: a package released as git tags; services and apps pin a tag",
ddiff --git a/browser/openvibe-sdk.mjs b/browser/openvibe-sdk.mjs
iindex 30cbdec..ba40249 100644
---- a/browser/openvibe-sdk.mjs
++++ b/browser/openvibe-sdk.mjs
@@@ -1,4 +1,4 @@
--// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.31.0, MIT). Do not edit.
++// Generated by scripts/browser-bundle.js from browser.js (openvibe-sdk 0.31.1, MIT). Do not edit.
// One self-contained ES module: core at the top level plus the browser-safe subpaths as namespaces
// (auth, registry, modules, realtime, media, community, bot, search, chat, ai, jobs, tools, projects, geo). No server-only code: no service tokens, JWT verification, events, identity.
/* eslint-disable */
@@@ -42,7 +42,7 @@ const { paginate, offsetPager } = __load(7);
const semver = __load(6);
/** The package version (test/version.test.js keeps it equal to package.json). */
--const SDK_VERSION = '0.31.0';
++const SDK_VERSION = '0.31.1';
module.exports = {
createClient,
ddiff --git a/package-lock.json b/package-lock.json
iindex a7dec81..9b7a048 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -1,12 +1,12 @@
{
"name": "openvibe-sdk",
-- "version": "0.31.0",
++ "version": "0.31.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openvibe-sdk",
-- "version": "0.31.0",
++ "version": "0.31.1",
"license": "MIT",
"devDependencies": {
"@electric-sql/pglite": "^0.5.8",
ddiff --git a/package.json b/package.json
iindex 93984d1..175c5f4 100644
---- a/package.json
++++ b/package.json
@@@ -1,6 +1,6 @@
{
"name": "openvibe-sdk",
-- "version": "0.31.0",
++ "version": "0.31.1",
"description": "Supported browser and server clients for the OpenVibe platform: auth (incl. developer apps), registry discovery, identity, user modules, events, realtime, media, community, Bot robots, search, chat, AI runs, Tools (registry, run API and jobs), VIP memberships and developer projects, the async PostgreSQL data layer (db) and the Valkey cache, limits store, queue and pub/sub, with deadlines, safe retries, problem errors and trace propagation.",
"main": "index.js",
"types": "types/index.d.ts",
ddiff --git a/src/core/index.js b/src/core/index.js
iindex db1b361..3820879 100644
---- a/src/core/index.js
++++ b/src/core/index.js
@@@ -8,7 +8,7 @@ const { paginate, offsetPager } = require('./paginate');
const semver = require('./semver');
/** The package version (test/version.test.js keeps it equal to package.json). */
--const SDK_VERSION = '0.31.0';
++const SDK_VERSION = '0.31.1';
module.exports = {
createClient,
ddiff --git a/src/testing/db.js b/src/testing/db.js
iindex 8efa8eb..64b8ba0 100644
---- a/src/testing/db.js
++++ b/src/testing/db.js
@@@ -209,6 +209,9 @@ async function createTestDb({ migrations, seed, seedKey, store = process.env.OV_
let releasingLease = false;
try {
await lease.connect();
++ // The lease socket must not keep the process alive: a test file that ends without process.exit() would otherwise
++ // never exit (0.26-0.31.0). It still holds the advisory lock for as long as the process lives.
++ if (lease.connection && lease.connection.stream && typeof lease.connection.stream.unref === 'function') lease.connection.stream.unref();
await lease.query('SELECT pg_advisory_lock($1::bigint)', [leaseKey(name)]);
lease.on('end', () => { if (!releasingLease) throw new Error(`test database lease lost for ${name}`); });
const database = await su.value('SELECT current_database()');