Preserve throwing global getter behavior in authored-preview VM fixtures
I maintainer di solito rispondono entro 1 giorno
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
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.
- Lingua principale
- JavaScript
- Stelle
- 38
- Fork
- 32
- Merge medio
- 31m
- PR unite (30g)
- 995
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di atomantic/PortOS
-
effort:medium model:medium plan planner:opus-5-5 security
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
effort:small model:medium
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
atomantic/PortOS#12526 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Fork PR heads named like a local branch (e.g. main) attach the wrong branch or fail to attachApertabug effort:high model:heavy plan
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
bug effort:medium model:medium plan
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
area:federation bug data-integrity effort:medium model:heavy plan
Difficoltà 4/5 1-2 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di atomantic/PortOS
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
subhranshudash13-dotcom/Contribo#74 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 67/100
ThatGuySam/doesitarm#1114 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
laaielichter/Reverseport#44 ·
I maintainer di solito rispondono entro 1 giorno
-
failed for an unknown reason
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
OpenTermsArchive/contrib-declarations#4148 ·
I maintainer di solito rispondono entro 1 giorno