fix(web): initialize readers before opening directory outputs #12353
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12353"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-28T10:31:41Z.
What
Initialize a non-stream archive reader before opening its destination in
DirectoryWriter.add(). If initialization fails, no writable is acquired. Preserve the existing stream handling and cleanup behavior.Register
directory-writer.test.mjsin a dedicated step of the existing path-filtered PR Web tests job, in addition to the release-timetools/test_web.pycommand. It covers initialization ordering/failure, directory bypass, buffer content and close, read failure, bounded streaming, cancellation and lock release.Tested
Exact tested head:
0e9dba02ccdea1a4cd2dd58efabbe820ffb03a75; rebased onto current main785f7b35d9d26fbf09dc52f225b9d36ec83812b6. This is the explicit main snapshot observed for the final sync; subsequent upstream merges are not included in this claim.Windows: Python 3.14.3, Node 24.14.1, WinLibs GCC 15.2, CMake 4.3.1. WSL Ubuntu 26.04: Python 3.14.4, Node 22.22.1, GCC 15.2, CMake 4.2.3. Exact committed source archives were tested on the native Linux filesystem. All results below are local results at this head.
node --testcommands extracted from this head's.github/workflows/web-tests.yml: the existing 15 helper cases plusdirectory-writer.test.mjspass (16 total, no failures/skips) on both OSes. All six production browser modules passnode --check.relinker_webtarget in WSL with Emscripten 6.0.3, Ninja Release andANYPS5_BUILD_WASM=ON, then run the completepython3 tools/test_web.py --build BUILDcommand: passed on Linux and Windows. Windows runs the same WSL-built WASM/JavaScript artifacts under native Windows Node; this is not a Windows-host Emscripten build.The final heads of #12351 (
24fbd54aa5bf5edcdf662c01b50900c23b94b67f) and #12353 (0e9dba02ccdea1a4cd2dd58efabbe820ffb03a75) merge cleanly. Their PR-workflow additions occupy separate steps and both registrations survive the merge; neither PR requires the other first. Previous combined-run evidence belongs to its original snapshot and is not substituted for these exact-head runs.No local macOS/older-Python runtime, full native system-library build, GPU, PS5 or game execution was performed. The archive boundary fixtures do not establish browser filesystem behavior on a real title. Hosted jobs for this new head will be evaluated after publication and are not counted as local passes.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T10:49:43Z.
Review: APPROVED
Reviewed the resource-ordering change and ran the exact-head
directory-writer.test.mjs: 1 test passed, covering init-before-open, no output acquisition after init failure, buffered writes, read/write failures, stream cancellation, and lock release. The Windows relinker andoutput-directoryhosted checks pass; the macOS relinker jobs remain pending. No stream behavior change is introduced by this move.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T10:53:54Z.
Review: APPROVED
The refreshed conventions check now passes. My exact-head directory-writer test passed, and the hosted Linux/Windows relinker plus output-directory checks pass. macOS relinker jobs remain pending; the review is scoped to the changed initialization/resource-ordering behavior.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T11:17:34Z.
Review: CHANGES_REQUESTED
The exact-head regression test passes locally on Node 20.19.2 (
node --experimental-vm-modules --test demo/web/tests/directory-writer.test.mjs: 1 test passed), and the change is otherwise covered by the existing output-directory and relinker checks. I am requesting one CI registration fix before approval:.github/workflows/web-tests.ymlrunsnode --testonapp,batch,failure-report, andoutput-directorytests, but does not includedirectory-writer.test.mjs.tools/test_web.pyruns at release time, so it does not make this test part of pull-request CI. Please add the new test to the workflow command, then I can re-review the refreshed head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T11:30:50Z.
Review: COMMENTED
Re-reviewed exact head
89d2266a67a0287e87dfdb490900ab5805873d6a. The new dedicated pull-request workflow step now runsnode --test demo/web/tests/directory-writer.test.mjs, resolving the missing-CI blocker. Locally on Node 20.19.2, the existing four-file Web test command passed 15 tests, and the exact new directory-writer workflow command passed 1 test;git diff --check upstream/main...HEADpassed. I have not approved yet while the refreshed hosted checks are queued.