Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

build(deps-dev): bump happy-dom from 20.14.6 to 21.0.1 in /client (#12199)

dependabot[bot]7eadfa247dd0
diff --git a/client/package-lock.json b/client/package-lock.json
index c360f97844..a5eaa1db3c 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -29,7 +29,7 @@
"@testing-library/react": "16.3.3",
"@testing-library/user-event": "14.6.8",
"@vitejs/plugin-react": "6.1.2",
- "happy-dom": "20.14.6",
+ "happy-dom": "21.0.1",
"playwright-core": "1.64.0",
"rollup-plugin-visualizer": "7.1.1",
"tailwindcss": "4.3.3",
@@ -2239,9 +2239,9 @@
"license": "ISC"
},
"node_modules/happy-dom": {
- "version": "20.14.6",
- "resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-20.14.6.tgz",
- "integrity": "sha512-5DDsf4QmEIlRL6NkCv/fxSjYHHkZceL/IaYQdJc2h3G7DRTEai++VTjbfL0LB9geW2VrA3+vrjF3Efx+OTtX0Q==",
+ "version": "21.0.1",
+ "resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-21.0.1.tgz",
+ "integrity": "sha512-pRBs/u9fhrncyByOl58DMex0R2uAj6ZPKWIjV5j5yNGZBqLw3P6BTRhlc0DD5b/Ht4/6JYTMuE2LJhUWRC6SGw==",
"dev": true,
"license": "MIT",
"dependencies": {
diff --git a/client/package.json b/client/package.json
index e612d9188f..4be1c6e42a 100644
--- a/client/package.json
+++ b/client/package.json
@@ -40,7 +40,7 @@
"@testing-library/react": "16.3.3",
"@testing-library/user-event": "14.6.8",
"@vitejs/plugin-react": "6.1.2",
- "happy-dom": "20.14.6",
+ "happy-dom": "21.0.1",
"playwright-core": "1.64.0",
"rollup-plugin-visualizer": "7.1.1",
"tailwindcss": "4.3.3",
diff --git a/client/src/components/messages/MessageDetail.test.jsx b/client/src/components/messages/MessageDetail.test.jsx
index 033d9a37fe..65bdf265c5 100644
--- a/client/src/components/messages/MessageDetail.test.jsx
+++ b/client/src/components/messages/MessageDetail.test.jsx
@@ -1,4 +1,4 @@
-import { describe, expect, it, vi } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
const api = vi.hoisted(() => ({
@@ -47,6 +47,17 @@ function iframeCsp() {
}
describe('MessageDetail SafeHtmlBody remote content blocking', () => {
+ beforeEach(() => {
+ // Happy DOM 21 disables iframe loading, including the blank document.
+ // Supply only an inert writable document; keep remote frame loading disabled.
+ const documents = new WeakMap();
+ vi.spyOn(HTMLIFrameElement.prototype, 'contentDocument', 'get').mockImplementation(function () {
+ if (!documents.has(this)) documents.set(this, document.implementation.createHTMLDocument(''));
+ return documents.get(this);
+ });
+ });
+ afterEach(() => vi.restoreAllMocks());
+
it('blocks remote images by default via a restrictive CSP and shows the opt-in notice', async () => {
renderMessage({
...baseMessage,
diff --git a/client/src/hooks/useEidoverseFrame.test.jsx b/client/src/hooks/useEidoverseFrame.test.jsx
index cc4657589f..c47313e1e4 100644
--- a/client/src/hooks/useEidoverseFrame.test.jsx
+++ b/client/src/hooks/useEidoverseFrame.test.jsx
@@ -1,8 +1,9 @@
-import { afterEach, describe, expect, it, vi } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { act, fireEvent, render, screen } from '@testing-library/react';
import { MemoryRouter, useLocation } from 'react-router';
import useEidoverseFrame from './useEidoverseFrame';
import { safeRemoveStorage, safeWriteStorage } from '../lib/safeStorage';
+import { mockFrameWindows } from '../test/mockFrameWindows.js';
const hostUrl = 'https://world.example.com/';
const objects = [{ id: 'portos-design-v2-signal-app-example', route: '/apps' }];
@@ -29,6 +30,7 @@ afterEach(() => {
});
describe('hosted Eidoverse frame navigation', () => {
+ beforeEach(mockFrameWindows);
it('waits for the current renderer departure acknowledgement before retiring its frame', async () => {
let frame;
render(<MemoryRouter><Harness capture={(value) => { frame = value; }} /></MemoryRouter>);
diff --git a/client/src/pages/Eidoverse.test.jsx b/client/src/pages/Eidoverse.test.jsx
index d2a0c06055..65ac44daef 100644
--- a/client/src/pages/Eidoverse.test.jsx
+++ b/client/src/pages/Eidoverse.test.jsx
@@ -4,6 +4,7 @@ import { act, fireEvent, render, screen, waitFor, within } from '@testing-librar
import userEvent from '@testing-library/user-event';
import { MemoryRouter } from 'react-router';
import { awaitEnabled, findEnabledByRole } from '../test/enabledBarrier.js';
+import { mockFrameWindows } from '../test/mockFrameWindows.js';
vi.mock('../services/api', () => ({
getApp: vi.fn(),
@@ -128,6 +129,7 @@ const renderPage = (entry = '/eidoverse') => render(
describe('Eidoverse hosted page', () => {
beforeEach(() => {
vi.clearAllMocks();
+ mockFrameWindows();
api.getInstanceFeatures.mockResolvedValue(featureResponse());
api.getApp.mockResolvedValue({ id: setup.appId, overallStatus: 'online' });
api.getAppRepositorySources.mockResolvedValue({ updateAvailable: false, sources: [] });
diff --git a/client/src/test/README.md b/client/src/test/README.md
index d6f8ab37b2..4f0ac9e9f6 100644
--- a/client/src/test/README.md
+++ b/client/src/test/README.md
@@ -19,6 +19,7 @@ a new one.
| `formValidityPolyfill.js` | Fixes happy-dom's constraint-validation (`stepMismatch`) so implicit form submission behaves like a real browser. |
| `imageGenPageMocks.jsx` | Shared `vi.mock` scaffold + fixtures + `renderImageGenPage()` for the ImageGen page suites. |
| `mockEventSource.js` | Minimal `EventSource` stand-in for jsdom, with manual `emit`/`emitRaw`/`fail` control. |
+| `mockFrameWindows.js` | `mockFrameWindows` — per-iframe postMessage identities for protocol tests while remote frame loading stays disabled; callers restore spies at teardown. |
| `pageLoadBarrier.js` | `awaitPageLoaded` — waits for a page's loading skeleton (by its accessible label) to be removed. |
| `pageNavTabAssertions.js` | Pins a tabbed page's rendered tab id/label list against drift from the nav manifest it was built from. |
| `settledInput.js` | `typeSettled`/`clearSettled`/`retypeSettled` — waits for a controlled input's value to actually reflect the typed text before it's read. |
diff --git a/client/src/test/mockFrameWindows.js b/client/src/test/mockFrameWindows.js
new file mode 100644
index 0000000000..4acdd70987
--- /dev/null
+++ b/client/src/test/mockFrameWindows.js
@@ -0,0 +1,11 @@
+import { vi } from 'vitest';
+
+// Protocol tests supply messages themselves. Keep one inert window identity per
+// iframe without enabling Happy DOM's remote page loading; restore spies at teardown.
+export function mockFrameWindows() {
+ const windows = new WeakMap();
+ vi.spyOn(HTMLIFrameElement.prototype, 'contentWindow', 'get').mockImplementation(function () {
+ if (!windows.has(this)) windows.set(this, { postMessage: vi.fn() });
+ return windows.get(this);
+ });
+}
diff --git a/scripts/run-ci-tests.test.js b/scripts/run-ci-tests.test.js
index 3b073d3d65..0c76022d50 100644
--- a/scripts/run-ci-tests.test.js
+++ b/scripts/run-ci-tests.test.js
@@ -706,7 +706,9 @@ describe('report launcher subprocess lifecycle (#9804)', () => {
expect(existsSync(liveRoot)).toBe(true);
expect(alive(live.child.pid)).toBe(true);
expect(existsSync(join(host, 'unrelated-old'))).toBe(true);
- expect(existsSync(join(host, 'portos-vitest-legacy-old'))).toBe(false);
+ // Windows has no process snapshot reader: dead-owner evidence permits
+ // cleanup above, but age alone cannot prove a pid-less root is unused.
+ expect(existsSync(join(host, 'portos-vitest-legacy-old'))).toBe(process.platform === 'win32');
expect(existsSync(join(host, 'portos-vitest-legacy-fresh'))).toBe(true);
} finally {
await Promise.allSettled(runs.map(run => run.cleanup()));
diff --git a/server/test/staleRunRoots.test.js b/server/test/staleRunRoots.test.js
index 619c766114..c9ba1f7a33 100644
--- a/server/test/staleRunRoots.test.js
+++ b/server/test/staleRunRoots.test.js
@@ -8,6 +8,10 @@ let host;
beforeEach(() => { host = mkdtempSync(join(tmpdir(), 'srr-test-')); });
afterEach(() => { rmSync(host, { recursive: true, force: true }); vi.restoreAllMocks(); });
+// A complete synthetic snapshot makes the age-policy contract independent of
+// native process-list support (Windows deliberately has no such reader).
+const read = () => [{ pid: process.pid, ppid: process.ppid }];
+
const makeRoot = (name, { owner, ageMs = 0 } = {}) => {
const root = join(host, name);
mkdirSync(root);
@@ -28,7 +32,7 @@ describe.each(['pvt-', 'portos-vitest-'])('sweepStaleRunRoots (%s)', (prefix) =>
const otherPrefix = makeRoot(prefix === 'pvt-' ? 'portos-vitest-dead' : 'pvt-dead', { owner: '111 1000' });
- sweepStaleRunRoots(host, { prefix, probe: ({ pid }) => pid === 222 });
+ sweepStaleRunRoots(host, { prefix, read, probe: ({ pid }) => pid === 222 });
expect(existsSync(dead)).toBe(false);
expect(existsSync(live)).toBe(true);
@@ -42,11 +46,17 @@ describe.each(['pvt-', 'portos-vitest-'])('sweepStaleRunRoots (%s)', (prefix) =>
it('falls back to the age rule when liveness is undeterminable (probe returns null)', () => {
const fresh = makeRoot(prefix + 'unknown-fresh', { owner: '5 1' });
const old = makeRoot(prefix + 'unknown-old', { owner: '5 1', ageMs: STALE_ROOT_AGE_MS + 60_000 });
- sweepStaleRunRoots(host, { prefix, probe: () => null });
+ sweepStaleRunRoots(host, { prefix, read, probe: () => null });
expect(existsSync(fresh)).toBe(true);
expect(existsSync(old)).toBe(false);
});
+ it('preserves pid-less old roots when process inspection is unavailable', () => {
+ const root = makeRoot(prefix + 'uninspected', { ageMs: STALE_ROOT_AGE_MS * 2 });
+ sweepStaleRunRoots(host, { prefix, read: () => null });
+ expect(existsSync(root)).toBe(true);
+ });
+
it('keeps a root owned by this very process (real probe, real owner file)', () => {
const root = makeRoot(prefix + 'self');
writeOwnerFile(root);