Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Project archives silently replace existing assets when external paths collide

オープン
#6,721 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@AksharP5 がすでに取り組んでいます。

2026年10月29日 から。

  • #6722 @AksharP5 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
bun, node.js, typescript
領域
backend, cli

調査の方向性

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
  1. Create the synthetic project above. Its first image references an existing red logo and its third image references a different green sibling logo.
  2. Run the public cloud render --dry-run --json command. It uses the same archive staging as publish without uploading anything.
  3. 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分
マージ済み PR(30日)
781

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

heygen-com/hyperframes のほかの issue

heygen-com/hyperframes の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。