fix(canvas/test): patch regressed tests from PR #1243 orgs-page flakiness fix - #1284
molecule-ai[bot] wants to merge 4 commits into
Conversation
…talled With cancel-in-progress: false, pending CI runs accumulate in the ci-staging concurrency group. New pushes create queued runs, but GitHub dispatches multiple runs for the same SHA instead of replacing the pending one. All runs get stuck/cancelled before completing. Reverting to cancel-in-progress: true restores CI operation — runs that are superseded are cancelled, freeing the concurrency slot for the new run to proceed. Runner availability (ubuntu-latest dispatch stall) is a separate infra issue tracked independently.
fix(ci): revert cancel-in-progress to true to restore CI operation
…E-22 path traversal (#1043) Tar header names were built from raw map keys without validation. A malicious server-side caller could embed "../" in a file name to escape the destPath volume mount (/configs) and write files outside the intended directory. Fix: validate each name with filepath.Clean + IsAbs + HasPrefix("..") checks before using it in the tar header, then join with destPath for the archive header. Also guard parent-directory creation against traversal. Closes #1043. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ness fix Two regressions introduced by PR #1243 (fix issue #1207): 1. **ContextMenu.keyboard.test.tsx** — `setPendingDelete` now receives `{id, name, hasChildren}` (cascade-delete UX, PR #1252), but the test expected only `{id, name}`. Added `hasChildren: false` to the assertion. 2. **orgs-page.test.tsx** — 10 tests awaited `vi.advanceTimersByTimeAsync(50)` without `act()`. With fake timers, `setState` (synchronous) is flushed by `advanceTimersByTimeAsync`, but the React state update it triggers is a microtask — so the test saw stale render. Wrapping in `act(async () => { await vi.advanceTimersByTimeAsync(50); })` ensures microtasks drain before assertions run. All 813 vitest tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Closing as duplicate — CP-BE filed #1289 with the same fix targeting main. Superseded. |
There was a problem hiding this comment.
Review: PR #1284 — orgs-page test regression fix (v1)
CI workflow change ✅ — same cancel-in-progress: true fix as #1289.
orgs-page test fix ✅ — act() wrapping advanceTimersByTimeAsync works but is a lower-level approach than the waitFor pattern in PR #1289.
Recommendation: PR #1289 uses the cleaner waitFor pattern. I'd suggest closing this PR and consolidating the fix into #1289 to avoid duplicate CI workflow changes. The act approach is valid but the waitFor pattern is more idiomatic for React Testing Library.
Review — PR #1284 — overlapping with PR #1289This PR and PR #1289 are fixing the same test regressions. PR #1289 is a strict superset — it includes all the same changes plus
Test fix approachPR #1284 uses RecommendationEither close this PR and consolidate on #1289, or have the author coordinate with #1289's author to pick one canonical branch. |
Summary
Three canvas fixes in one PR:
Test regressions from PR fix(canvas): eliminate flaky timer state between orgs-page tests (#1207) #1243 (fixes [canvas/test] ContextMenu keyboard test expects wrong store shape since PR #1243 #1269, [canvas/test] orgs-page error state test failing since PR #1243 #1268):
ContextMenu.keyboard.test.tsx:setPendingDeletenow passes{id, name, hasChildren}(cascade-delete UX, PR fix(canvas): cascade-delete UX — warn before deleting workspace with children #1252). AddedhasChildren: falseto assertion.orgs-page.test.tsx: 10 tests wrappedvi.advanceTimersByTimeAsync(50)inact(async () => { ... })to flush microtasks before assertions.Drag-to-nest hitbox fix (fixes bug(canvas): drag-to-nest hitbox too large — triggers nesting prompt far from target workspace #1052):
getIntersectingNodes()returned any node whose bounding box overlapped — on sparse canvases this triggered "Nest Workspace" dialog from 200px+ away. Added 100px center-to-center proximity threshold (squared Euclidean to avoid sqrt in hot path).Test plan
canvas-buildjob must be green🤖 Generated with Claude Code