Repository navigation
fix(studio-server): keep long file paths from blocking saves - #6611
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
Independent GPT-6 Astra high review of exact head The reviewer independently passed 120 focused tests and 29 controls. Real HTTP comparisons reproduced the long-path save/delete failure on the merge-base and successful operations at this head, with the exact prior bytes backed up. Short names, UTF-8 paths, legacy retention, same-time filename collisions and source preservation when backups fail also passed. The review reused verified existing build artifacts; it did not repeat a fresh workspace build, native Windows/macOS, browser UI or local Mintlify validation. All 12 required checks pass at this head; the final check snapshot has no failed or pending jobs. Jrusso approved this exact head after source review and bounded path controls. His filesystem integration attempt was blocked by missing dependencies; the independently completed test results above remain the test evidence. GitHub reports APPROVED and MERGEABLE, with no unresolved review threads. No merge performed. |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at a0ff087990820ec182622577516e58ddcaf0a5be.
I checked the bounded backup key, legacy retention matching and file-route tests. Long names use a SHA-256 key while short names keep the existing format.
Attempted vitest backupJournal.test.ts files.longPaths.test.ts: collection blocked by missing hono and @hyperframes/core. No filesystem integration pass completed. Fresh independent source and bounded path controls also passed.
Need: yes · Size: ok · Reuse: existing implementation seam · Simpler: already minimal · Structure: fine
Risk: medium - backup identity and retention.
Verdict: APPROVE
Reasoning: I checked the bounded backup key, legacy retention matching and file-route tests. Long names use a SHA-256 key while short names keep the existing format.
Reasoning: I checked the bounded backup key, legacy retention matching and file-route tests. Long names use a SHA-256 key while short names keep the existing format.
…com#6605 heygen-com#6611 heygen-com#6831 heygen-com#6800 Windows debug.log lock, PowerShell UTF-16 batch JSON, long backup names, --variables-file readFile override, Figma motion key collisions. Rest deferred with per-commit evidence; 72 PRs pinned in monitored. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: SanHsien <[email protected]>
What
Studio can create and read a file in a nested project folder, then reject its saves and deletes with
backup failed: ENAMETOOLONG. A legal 180-byte relative path becomes one 265-byte backup filename.The backup journal now hashes encoded paths longer than 200 characters. Save and delete succeed with recoverable prior bytes, while shorter backup names and fail-closed behavior remain unchanged.
Why
The old key includes every parent folder in one base64url filename. Bounding that key leaves room for the timestamp and collision suffix. Pruning recognizes both old and new keys so older snapshots still count toward the per-file limit.
Related work
Fixes #6610
#1388 introduced the journal; #3957/#3961 enforce backup failures. The source-filename temp suffix limit in #4777 and Windows staging-directory work in #6492 are separate. No rendering, SDK or parser changes.
How
One helper owns backup naming and retention. Regression tests exercise save/delete through the file routes with a nested path and a UTF-8 filename, separate long paths with identical basenames, and retention of existing base64-named snapshots. The package docs describe backup responses and long paths.
Before / after
introduction.txtat the 180-byte relative path shown herebeforebeforeafterusing the read ETagbackup failed: ENAMETOOLONGbeforeafterbeforebackup failed: ENAMETOOLONGtruefalseafterComplete reproduction
Run from this repository on Node 24 and Bun, using upstream main
8b1f88b3c06175f43fbdbe1af6e53933847cb195for the baseline:Save the following as
repro.mjsin the repository root, then runnode repro.mjs. It creates a synthetic temporary project and exercises the publiccreateStudioApi()over loopback HTTP with real filesystem operations. No browser, renderer, mocked filesystem or external media is involved.For the fixed comparison, keep the same
repro.mjsand run:Test plan
Verified head:
a0ff087990820ec182622577516e58ddcaf0a5be. The fetched commit tree matches the tested index exactly; GitHub GraphQL and REST both verify its signature.bun run buildafter the authorized frozen dependency install;bun.lockunchanged.No Windows or browser UI run is claimed. Mintlify validation was unavailable because
mintis not installed; the MDX change was inspected directly.