HTML file preview in the integrated browser 404s relative video and audio assets
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- html, nodejs, typescript
Hướng nghiên cứu
Start in apps/server/src/assets/AssetAccess.ts at PREVIEW_ASSET_EXTENSIONS and the resolveAsset() extension check, which returns null for .mp4, .webm, .m4v and .mp3. The media MIME inference in packages/shared/src/video.ts and range support in assetFileResponse already exist. Done means a relative video or audio request under a workspace-file grant returns 200 with range support. A linked pull request (#36199) is already open against this, so it is not a free first pick.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened
An agent wrote a local gallery page (index.html next to clips/*.mp4) and linked it from a thread. Clicking the link opens it in the integrated browser. The page shell renders, but every video is empty and each video request returns 404.
The page is served at /api/assets//index.html, so each relative resolves to /api/assets//clips/foo.mp4, which 404s. The token is intact and correctly scoped to the page's folder; only media file types are refused.
Diagnosis
For a workspace HTML entry, AssetAccess issues a folder-scoped "workspace-file" grant (baseRelativePath = path.dirname(page)) and lets the page load dependency files under the same signed token. Dependencies are gated by PREVIEW_ASSET_EXTENSIONS in apps/server/src/assets/AssetAccess.ts: browser-preview types (.html/.htm/.pdf), images (.avif/.gif/.ico/.jpeg/.jpg/.png/.svg/.webp), .css, .js, .mjs and fonts.
.mp4/.webm/.m4v/.mp3 are not in that set, so resolveAsset() returns null at the extension check and the HTTP route answers 404 Not Found. MIME inference already exists (packages/shared/src/video.ts, hostPreviewMimeTypeFromExtension) and range requests are already supported by assetFileResponse, so the allowlist is the only blocker.
The same allowlist is still on main today, so this is not fixed in a newer build. Closest issue is #26902, but that one is about the token segment being stripped by ../ path normalization; here the token is intact and the extension gate rejects the request.
Steps to reproduce
- In a project, create:
site/index.html ->
site/clips/clip.mp4 - From a thread whose cwd is that project, open site/index.html in the integrated browser (click a link to its absolute path, or "Open in Browser").
- The page renders at /api/assets//index.html, but GET /api/assets//clips/clip.mp4 returns 404. A sibling relative .jpg in the same folder returns 200, so the grant and relative resolution are fine.
Same for audio.
Version
0.1.7
Environment
Client: T3 Code Desktop 0.1.7 on Windows. Server: T3 Code 0.1.7 on Linux (WSL2, 6.18 kernel), Node v26.12.1, started as t3 serve; desktop app connected to that server. Preview: integrated browser.
Evidence
Requests replayed against the running 0.1.7 server with the token from the preview page:
GET /api/assets/<token>/index.html 200 text/html; charset=utf-8
GET /api/assets/<token>/sheet/contact.jpg 200 image/jpeg
GET /api/assets/<token>/clips/aquatic-p5-60fps.mp4 404 text/plain
The token decodes to {"kind":"workspace-file","workspaceRoot":"<worktree>","baseRelativePath":"dev/record/.work/proto60"}, and the .mp4 exists at that path.
apps/server/src/assets/AssetAccess.ts (v0.1.7):
const PREVIEW_ASSET_EXTENSIONS = new Set([
...WORKSPACE_BROWSER_PREVIEW_EXTENSIONS,
".avif", ".gif", ".ico", ".jpeg", ".jpg", ".png", ".svg", ".webp",
".css", ".js", ".mjs", ".otf", ".ttf", ".woff", ".woff2",
]);
...
if (!PREVIEW_ASSET_EXTENSIONS.has(path.extname(decodedPath).toLowerCase())) return null;
No trace line is left for the 404: asset requests are excluded from tracing on purpose (http.ts, UNTRACED_REQUEST_PATHS).
Related issues
#26902 (HTML previews don't load ../ relative resources; same resolution code, different cause). #20887 (closed; mobile file tree relative links /api/assets 404). #32898 (server browser opens /api/assets on the client's origin; different). Not duplicates.
Fix applied or workaround
Serve the folder over HTTP and open that URL in the preview panel:
python3 -m http.server 8123 --bind 127.0.0.1
http://127.0.0.1:8123/index.html
Relative paths then resolve as normal web paths. Opening one clip's own link in chat also still plays it.
Filed by
DeepSeek V4.1 Flash via opencode, t3 triage
- Ngôn ngữ chính
- TypeScript
- Star
- 24.8k
- Fork
- 6.4k
- Merge trung bình
- 59 phút
- Pull request đã merge (30 ngày)
- 418
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pingdotgg/t3code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: MCP App inline frames never go below 80px, so compact apps get blank space under themĐang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Question card options show LaTeX as raw source, though the question text renders itCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Settings inheritance popover shows raw slugs for branch naming, default permissions and response streamingCó thể đã có người làm @juliusmarminge đã nhận 1 ngày trước. Đang mởvouch:denounced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pingdotgg/t3code
Issue tương tự
-
bug platform:mobile root-cause:found
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openchamber/openchamber#6926 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
push-based/user-flow#356 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Cygnux-Labs/Tracekit#827 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
www build: a refused import shows only "ENOENT scandir <outDir>", never the build-audience errorĐang mởkind:defect
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightgauge/nightgauge#3266 ·
Maintainer thường phản hồi trong vòng 1 ngày