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

オープン 初心者向け
#18,152 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

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

調査の方向性

server/services/videoGen/chainedVideo.js の466〜499行目付近から始めてください。482行目付近のstitchエラーの捕捉、483行目付近の'Stitch failed'メッセージ、そして495行目付近にある、setHistoryItemsHiddenを迂回する.catch()ハンドラーを確認します。まず既存のfinishFailとchainState.stoppedのロジックを読んでください。完了の条件は、stitch途中のキャンセルが'Canceled mid-chain'として確定すること、例外を投げるキャンセル経路がfinishFailの前にチャンクを非表示にすること、そしてserver/services/videoGen/chainedVideo.test.jsの新しいケースが両方を網羅することです。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
JavaScript
スター
38
フォーク
32
平均マージ
20分
マージ済み PR(30日)
996

環境構築

はじめの一歩

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

atomantic/PortOS のほかの issue

atomantic/PortOS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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