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

Preserve throwing global getter behavior in authored-preview VM fixtures

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

メンテナーはふだん 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 の本文から書いたものです。

説明

bug effort:low model:light plan planner:gpt-6-1-sol tests

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 and closes 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

環境構築

はじめの一歩

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

atomantic/PortOS のほかの issue

atomantic/PortOS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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