chainedVideo.js misreports mid-stitch cancellation as a stitch failure and skips chunk hiding on thrown cancel paths

Đang mở Phù hợp với người mới
#18,152 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue nà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
62/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ệ
javascript, node.js
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu từ server/services/videoGen/chainedVideo.js quanh các dòng 466-499: phần bắt lỗi stitch gần dòng 482, thông báo 'Stitch failed' gần dòng 483, và trình xử lý .catch() gần dòng 495 bỏ qua setHistoryItemsHidden. Hãy đọc trước logic hiện có của finishFail và chainState.stopped. Hoàn thành khi việc hủy giữa chừng quá trình stitch kết thúc với 'Canceled mid-chain', các đường hủy có ném lỗi ẩn các chunk trước finishFail, và các trường hợp mới trong server/services/videoGen/chainedVideo.test.js bao phủ cả hai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:media bug effort:low in-progress model:light plan planner:gemini-4-neon-high reliability-error-handling

Problem

In server/services/videoGen/chainedVideo.js:466-487, aborting stitchVideos via chainState.abortController causes line 482 to capture { error: 'Stitch canceled' }, and line 483-487 reports 'Stitch failed: Stitch canceled' without checking chainState.stopped. Separately, inter-chunk cancellation checks at lines 379, 440, 460, and 465 throw into the .catch() at lines 495-499, bypassing await setHistoryItemsHidden(chunkIds, true) that runs on all other terminal paths.

Impact

Canceling a chained render during its final stitch surfaces a misleading 'Stitch failed: Stitch canceled' error instead of a clean cancellation, and thrown mid-chain cancel exits skip the history-hiding pass performed by every other exit branch.

Decided Fix

In server/services/videoGen/chainedVideo.js:483, check if (chainState.stopped) before formatting 'Stitch failed: ...' so mid-stitch cancellation calls finishFail('Canceled mid-chain'), and run await setHistoryItemsHidden(chunkIds, true) in the .catch() handler at line 495 before finishFail so thrown cancel/error paths match the explicit terminal branches.

Affected Files

  • server/services/videoGen/chainedVideo.js

Acceptance Criteria

  • Canceling a chained video while stitchVideos is running settles the chain with 'Canceled mid-chain' rather than 'Stitch failed: Stitch canceled'.
  • Canceling a chained video between chunks (during probeFrameCount, trimVideoFromFrame, extractLastFrame, or before stitchVideos) runs setHistoryItemsHidden(chunkIds, true) before finishFail, matching every other terminal branch.
  • Unit tests in server/services/videoGen/chainedVideo.test.js verify mid-stitch and inter-chunk cancellation outcomes.

Origin: PortOS reliability-error-handling baseline audit (2026-11-24) · Severity: 5/10

Ngôn ngữ chính
JavaScript
Star
38
Fork
32
Merge trung bình
20 phút
Pull request đã merge (30 ngày)
996

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của atomantic/PortOS

Tất cả issue của atomantic/PortOS

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.