Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Preserve throwing global getter behavior in authored-preview VM fixtures

Chiusa Adatta ai principianti
#11,615 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@atomantic ci sta già lavorando.

Dal 16/10/2026.

  • #11625 di @atomantic — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, nodejs
Ambito
testing-qa

Direzione di ricerca

Le fixture che falliscono si trovano in server/services/musicVideo/documentRender.test.js e server/services/musicVideo/authoredPreviewPlayback.test.js; inizia eseguendo il comando npm test indicato nell'issue per vedere i 15 errori. L'issue dice che la modifica è limitata agli import di VM e alla costruzione del contesto in questi due file, che devono mantenere un unico contesto tra dichiarazione e ispezione. È completato quando entrambe le suite passano su Node 22, 24 e 26, il getter che lancia un'eccezione continua a rifiutare la promise e il test di pulizia dell'anteprima del documento continua a chiudere la pagina prima di rimuovere gli asset.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
JavaScript
Stelle
38
Fork
32
Merge medio
31m
PR unite (30g)
995

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di atomantic/PortOS

Tutte le issue di atomantic/PortOS

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.