Preserve throwing global getter behavior in authored-preview VM fixtures
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, nodejs
- 領域
- testing-qa
調査の方向性
失敗しているフィクスチャは server/services/musicVideo/documentRender.test.js と server/services/musicVideo/authoredPreviewPlayback.test.js にあります。まず issue に記載の npm test コマンドを実行し、15 件の失敗を確認してください。issue によれば、変更は これら 2 つのファイルの VM インポートとコンテキスト構築に限られ、宣言と検査の間で同じコンテキストを保持する必要があります。両方のスイートが Node 22、24、26 で通過し、例外を投げるゲッターが引き続き拒否され、ドキュメントプレビューのクリーンアップテストがアセットを削除する前にページを閉じることを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
The authored-preview test fixtures do not preserve browser behavior for throwing global getters on Node 26.10.0, a supported runtime. Node's contextified VM global can return undefined instead of propagating the getter error. The cleanup regression consequently resolves an unsupported preview instead of rejecting, and leaves its staged folder behind, causing subsequent cleanup assertions to fail.
Affected files:
server/services/musicVideo/documentRender.test.js: the authored browser fixture andcloses a page whose inspection throws before removing its assets.server/services/musicVideo/authoredPreviewPlayback.test.js:browser()and the root/Proxy inspection failure test.
This was reproduced while validating #11611 and remains present on its merged tree. This is a test-harness defect; no production behavior change is needed.
Reproduction
On Node 26.10.0, run:
npm test --prefix server -- --run services/musicVideo/documentRender.test.js services/musicVideo/authoredPreviewPlayback.test.js --maxWorkers=4
Observed: 15 failures, 54 passes. The first two failures expect inspection rejection; the remaining failures follow from the staged folder the unexpectedly successful preview retains. Local pregate also failed first at the document cleanup regression.
Minimal underlying behavior:
import { runInNewContext } from 'node:vm';
const context = { portosComposition: {} };
runInNewContext("Object.defineProperty(globalThis, 'portosComposition', { get() { throw Error('synthetic inspection failure'); } });", context);
runInNewContext('globalThis.portosComposition', context); // returns undefined
Expected: the fixture propagates the inspection error and proves that the page closes before staged assets are removed.
Chosen fix
Use createContext(constants.DONT_CONTEXTIFY) and runInContext in these two fixtures. Keep all existing production and cleanup assertions. This gives the fixture an ordinary global object with the getter semantics being tested. Add a short comment explaining why the context type matters.
The fix is prepared in local commit 9ef24400d288b6e96745d87f7ce2d1cc39ff4bd5. It was not pushed because #11611 was concurrently merged and its remote head deleted; its patch has been archived outside the managed worktree. Reimplementing it requires only changing the VM imports/context construction and preserving one context across declaration and inspection.
Validation of the prepared fix:
- Both affected suites: 69 tests pass on Node 22.22.3 and Node 26.10.0.
- Pregate: 1,146 files pass; 26,081 tests pass and 36 skip, with lint and hidden-content checks passing. This is planner-selected validation, not a full-suite result.
Dispatch: model:light because this is a verified, mechanical fixture correction in two files; effort:low because the cause and exact solution are reproduced.
Acceptance criteria
- Both affected suites pass on supported Node 22, 24, and 26 runtimes.
- Throwing root/Proxy inspection still rejects; no assertion is weakened or skipped.
- Document-preview rejection closes the page before deleting its scratch assets and preserves the original document.
- Pregate and the PR's selected CI checks pass.
- 主要言語
- JavaScript
- スター
- 38
- フォーク
- 32
- 平均マージ
- 42分
- マージ済み PR(30日)
- 992
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
atomantic/PortOS のほかの issue
-
effort:high model:medium perf performance plan planner:gpt-6-astra
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
effort:medium model:heavy perf performance plan planner:gpt-6-astra
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
Document-mode live preview re-runs the film look's SVG filter on every video frame対応中かも @atomantic が今日担当しました。 オープンarea:media bug effort:high in-progress model:medium plan
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
atomantic/PortOS#11221 · コメント 15 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
atomantic/PortOS の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
andromarces/agent-loops#886 ·
メンテナーはふだん 1 日以内に返信
-
B: visual
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
FreeTubeApp/FreeTube#9929 ·
メンテナーはふだん 1 日以内に返信
-
🐛 Bug: `--clear-screen` not very useful (at least not for dealing with large test/error output)オープンstatus: in triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
mochajs/mocha#6428 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
🔧 in development
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100