Repository navigation
fix(cli): cloud render finds files whose names the page writes with a percent escape - #8960
Conversation
terencecho
left a comment
There was a problem hiding this comment.
P2 · Use the same URL path for ranking and staging. In packages/cli/src/utils/publishProject.ts:759–775, relative references keep their query or fragment during the new existence check. Staging strips the suffix at line 594. With a literal percent-escaped filename in a nested composition and a query or fragment, neither spelling wins the ranking, so the decoded path can still report missing before the literal spelling is considered. Split the URL suffix before filesystem resolution and preserve it when rewriting. Cover a suffixed relative reference in the new staging tests.
P2 · Keep the new existence probe inside the filesystem boundary. The new existsSync runs before the existing network-root and link checks. Lexical containment does not establish that a path resolves within the project, and an existence probe can follow a symlink or junction. Choose among permitted candidates without following a link target during this preflight. The current direct-network-path test covers a different case.
This was source review at the pinned head. Required CI was still running.
— tai (automated review)
Edit accuracy: accurate 273 (base branch 271), smooth 49 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
|
Both findings fixed at Suffix (P2 1). Probe ahead of the checks (P2 2). No spelling is checked for existence before the usual path anymore. Each spelling goes through Proof. Each part was broken on its own:
With the fix, The description is frozen. This comment replaces its "How" section, and its test counts are now 4 new tests and 25 sibling files. |
terencecho
left a comment
There was a problem hiding this comment.
The previous suffix-lookup and existence-probe findings are resolved.
P2 · The nested literal filename still needs a URL the renderer can load. The new test only asserts the file is in the archive. The in-project relative branch in packages/cli/src/utils/publishProject.ts leaves the original URL in the page. Then packages/parsers/src/rewriteSubCompPaths.ts:85–91 probes only the decoded sibling when deciding whether to rebase a nested composition’s URL. I checked the pinned helper with the test’s literal-percent sibling: it returns clips/My%20Video.mp4#t=1 unchanged, so after inlining it still points at the root’s clips directory rather than the staged nested file. Either rewrite the selected filename to a correctly encoded URL before packaging or make the render-side rebase recognize the literal spelling. Add an assertion on the compiled URL or a render-facing test alongside the staging assertion.
The Comments job also failed because the comment share increased in publishProject.ts. CI log
— tai (automated review)
…name holds a percent escape
|
Both fixed at Nested literal filename (P2). The fix is on the render side, in New test in Comments gate. Suites at this head: |
terencecho
left a comment
There was a problem hiding this comment.
The nested asset rebase now selects the literal-percent sibling when the decoded sibling is absent, encodes the literal percent, and preserves the media fragment. All 17 targeted parser tests passed, and the new regression failed with the previous source. The Comments job and all applicable required checks passed. I did not run a cloud render.
— tai (automated review)
|
Render timing, main vs this branch at
All three are within 3%. The box was shared with other work, which is why each round was interleaved. |
What
hyperframes cloud renderno longer calls a file missing when the page writes its name with a percent escape, such asMy%20Video.mp4. The two cases fixed:assets/My%20Video.mp4and the project root holdsassets/My Video.mp4. This is the common one: a space in a file name, escaped in the page.%20in the saved name) and the page names it as written.Why
The local preview finds both files, because it tries the decoded name and then the name as written. The cloud upload refused the project instead:
The composition references "assets/My%20Video.mp4", which is not in the project folder.That happened although the file is there, so a video that plays locally could not be rendered in the cloud. A reference the film does not strictly need was left out of the upload without a word.Related work
None.
How
Both changes are in
packages/cli/src/utils/publishProject.ts:includeReferencedProjectFilelooked the project root up by the raw name only. It now tries every spellingdecodeUrlPathVariantsgives, decoded first, as the preview does.tryResolveExternalstops at the first spelling for a file inside the project folder. It now orders the spellings so that one present on disk inside the project folder comes first. When both or neither are present, the order is unchanged (decoded first). Only paths inside the project folder are checked, so the CLI still never looks at another computer's share or a device path.publishProject.networkShare.win32.test.tspins that, and it failed on a first version of this change that checked every spelling.Grep for other places that resolve a reference by its raw name (
resolve(<dir>, raw…)inpackages/cli/src, tests excluded): none.Test plan
publishProject.missing.test.ts, "a file named with a percent escape", with 3 tests: the escaped space resolved from the root, a file whose own name holds the escape, and a refusal when neither spelling is on disk.origin/mainboth staging tests fail withThe composition references "...%20Video.mp4", which is not in the project folder.Reverting only the root lookup fails only the first test, and reverting only the ordering fails only the second. With the fix the file passes 3 runs in a row (11/11).src/utils/publishProject*,src/commands/cloud/*,urlPathandprivateProjectFiletest file passes (23 files, 315 tests).packages/clisuite on a Linux box: 4 files fail (snapshot,snapshotHdrFrame,measure/diff-offset,measure/media, 14 frame-decoding tests), and the same 14 fail on unmodifiedorigin/mainon that box, so they come from its ffmpeg, not from this change.