Project archives silently replace existing assets when external paths collide
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- bun, node.js, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 54.1k
- Fork
- 4.9k
- Merge medio
- 8h 46m
- PR unite (30g)
- 781
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di heygen-com/hyperframes
-
render: --variables-file (and --variables <path>) fails with "io.readFile is not a function" since 0.8.212Forse già presa @miguel-heygen l’ha presa oggi. Apertabug triage/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
heygen-com/hyperframes#6830 ·
I maintainer di solito rispondono entro 1 giorno
-
`motionContextToDocs`: `y` track copies `opacity` when a node animates both (key lookup has no word boundary)Forse già presa @Muzzy5150 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
heygen-com/hyperframes#6756 ·
I maintainer di solito rispondono entro 1 giorno
-
Batch rendering rejects JSON files saved with a byte order markForse già presa @AksharP5 l’ha presa 3 giorni fa. Apertabug triage/ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
heygen-com/hyperframes#6604 ·
I maintainer di solito rispondono entro 1 giorno
-
bug difficulty/easy triage/ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
heygen-com/hyperframes#6481 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Timeline: show a clip's full name when its label is cut offForse già presa @DanielMcSheehy l’ha presa 12 giorni fa. Apertadesktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
heygen-com/hyperframes#5582 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di heygen-com/hyperframes
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Automattic/data-liberation-agent#1115 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Enhance blog readabilityApertaCSS enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pychess/pychess-variants#2448 ·
I maintainer di solito rispondono entro 1 giorno
-
[architect] Stale planning/scratch files at repo root (COMPONENT_SPLIT_SUMMARY.md etc.) describe already-completed workForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/architect architecture help wanted stage/040-covered-by-pr tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubestellar/console#24716 ·
I maintainer di solito rispondono entro 1 giorno
-
helm-knative-apply.sh fails with Helm 4Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea: triage theme: undefined
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
jhipster/generator-jhipster#35895 ·
I maintainer di solito rispondono entro 1 giorno