Algorithm did a single DFS pass over all nodes in input order, which placed orphan nodes (parentId → missing node) before roots when the orphan appeared earlier in the input array. Tests: sortParentsBeforeChildren "does not crash when parentId references a missing node" was failing. Fix: two-pass approach — visit all root nodes first, then remaining unvisited nodes (orphans). Preserves existing correct behaviour for valid parent→child chains. Also: - canvas/vitest.config.ts: add clarifying comment that Node environment is intentional (socket.url.test.ts runs in Node, DOM tests use the per-file // @vitest-environment jsdom directive). - canvas/src/store/__tests__/socket.url.test.ts: simplify — drop the importWsUrl helper (no longer needed since env handling is direct and Node's lack of window.globalThis correctly triggers the localhost:8080 fallback in deriveWsBaseUrl). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| e2e | ||
| public | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| components.json | ||
| Dockerfile | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| playwright.staging.config.ts | ||
| postcss.config.js | ||
| tsconfig.json | ||
| vitest.config.ts | ||