Project archives silently replace existing assets when external paths collide
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- bun, node.js, typescript
调研方向
Read packages/cli/src/utils/publishProject.ts, especially localizeExternalAssets and addExternalAsset, then run the synthetic reproduction with cloud render --dry-run --json and inspect the archive. Done means existing red and blue assets retain their contents and paths, both green references point to a separate archived file, and the archive contains four files including index.html.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Packing a project can silently replace a project asset with an unrelated external asset. The published/cloud-rendered project then displays the wrong image even though the local files are unchanged and archive preparation succeeds.
This affects projects that already contain an _ext/ directory, including source unpacked from a HyperFrames project archive, and then reference another sibling asset whose localized name collides with an existing file.
Minimal reproduction
Run from a built repository checkout with Bun and Node 22+:
#!/usr/bin/env bash
set -euo pipefail
# Run from a built repository checkout. All inputs are synthetic.
proof_dir=$(mktemp -d)
mkdir -p "$proof_dir/project/_ext/shared" "$proof_dir/shared"
for pair in 'project/_ext/shared/logo.svg red' 'project/_ext/shared/logo_2.svg blue' 'shared/logo.svg green'; do
read -r name color <<< "$pair"
printf '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="%s"/></svg>' "$color" > "$proof_dir/$name"
done
cat > "$proof_dir/project/index.html" <<'HTML'
<html><body><div data-composition-id="logos" data-width="400" data-height="100" data-duration="1" data-no-timeline><img src="_ext/shared/logo.svg"><img src="_ext/shared/logo_2.svg"><img src="../shared/logo.svg"><img src="../shared/logo.svg"></div></body></html>
HTML
HYPERFRAMES_NO_UPDATE_CHECK=1 HYPERFRAMES_SKIP_SKILLS=1 DO_NOT_TRACK=1 node packages/cli/bin/hyperframes.mjs cloud render "$proof_dir/project" --dry-run --json
(cd packages/cli && bun --eval '
import { createPublishArchive } from "./src/utils/publishProject.ts";
import AdmZip from "adm-zip";
const zip = new AdmZip(createPublishArchive(process.argv[1]).buffer);
console.log("entries", zip.getEntries().map(entry => entry.entryName));
console.log("original red preserved", zip.readAsText("_ext/shared/logo.svg").includes("fill=\"red\""));
console.log("new green separately archived", zip.readAsText("_ext/shared/logo_3.svg").includes("fill=\"green\""));
console.log("HTML", zip.readAsText("index.html"));
' "$proof_dir/project")
printf 'Synthetic fixture retained at %s\n' "$proof_dir"
Steps to reproduce
- Create the synthetic project above. Its first image references an existing red logo and its third image references a different green sibling logo.
- Run the public
cloud render --dry-run --jsoncommand. It uses the same archive staging aspublishwithout uploading anything. - Inspect the resulting ZIP through
createPublishArchive, also used by publish/cloud rendering.
Expected behavior
All three distinct assets survive. The existing red and blue assets retain their paths; both green references point to a separately archived file. There should be four files including index.html.
Actual behavior
The command exits 0 and reports file_count: 3. The ZIP's _ext/shared/logo.svg contains the green asset's bytes. The first and third images both reference that key, so the original red image is silently replaced. original red preserved and new green separately archived both print false.
Environment
Main 49e0312300d6c049b19eb8435930f980621a993f, Linux arm64, Bun 1.4.4, Node v24.22.1. Reproduced with synthetic SVGs and the actual CLI dry-run. No authenticated cloud job or publish request is needed.
Additional context
localizeExternalAssets creates an empty usedArchivePaths set even though the file map already contains project files. addExternalAsset therefore treats an existing key as available and replaces it. Its existing suffix loop already handles collisions between newly localized external files; the initial staged project files need to participate too.
Searched live open/closed issues and PRs for publish overwrite, archive collision, _ext, usedArchivePaths, and archive existing, and read the related #1160/#2595/#5309/#6266 discussions. #6265's documented query/fragment omissions are a separate problem. #6687 changes OAuth endpoint selection in the same file and does not cover archive paths.
- 主要语言
- TypeScript
- 星标
- 54.1k
- 派生
- 4.9k
- 平均合并
- 8 小时 46 分钟
- 30 天内合并 PR
- 781
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
heygen-com/hyperframes 的其他 Issue
-
render: --variables-file (and --variables <path>) fails with "io.readFile is not a function" since 0.8.212可能已有人在做 @miguel-heygen 今天认领。 未关闭bug triage/needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
heygen-com/hyperframes#6830 ·
维护者通常 1 天内回复
-
`motionContextToDocs`: `y` track copies `opacity` when a node animates both (key lookup has no word boundary)可能已有人在做 @Muzzy5150 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
heygen-com/hyperframes#6756 ·
维护者通常 1 天内回复
-
Batch rendering rejects JSON files saved with a byte order mark可能已有人在做 @AksharP5 于 2 天前认领。 未关闭bug triage/ready
难度 2/5 1-3 小时 新手友好度 74/100
heygen-com/hyperframes#6604 ·
维护者通常 1 天内回复
-
bug difficulty/easy triage/ready
难度 2/5 1-3 小时 新手友好度 78/100
heygen-com/hyperframes#6481 · 2 条评论 ·
维护者通常 1 天内回复
-
Timeline: show a clip's full name when its label is cut off可能已有人在做 @DanielMcSheehy 于 12 天前认领。 未关闭desktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 85/100
heygen-com/hyperframes#5582 · 2 条评论 ·
维护者通常 1 天内回复
查看 heygen-com/hyperframes 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 86/100
awslabs/visual-asset-management-system#937 ·
维护者通常 1 天内回复
-
t0ggles
难度 1/5 1 小时以内 新手友好度 82/100
nolimits4web/swiper#8255 · 1 条评论 ·
维护者通常 15 天内回复
-
bug launch local use
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
account: profile bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100