fix: finish directory writer cleanup when cancellation rejects #6780

Merged
MrMha merged 1 commit from upstream-pr/6780 into main 2026-10-19 10:34:31 +00:00
MrMha commented 2026-10-16 11:31:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MrMha on 2026-10-16T11:31:38Z.


What

When a directory-output read fails, cancelling an already errored ReadableStream rejects. That rejection previously skipped output abort; a cancellation or abort failure could also replace the original conversion error. Settle both cleanup operations before rethrowing the original failure, and preserve that failure for blob-reader cleanup too. Export the existing writer for direct stream regression coverage.

Tested

macOS 27.0.1 arm64, based on main 7dcfff559f68fc4ffb52f836134d3133492a3d00. The Node archive-root suite passes, including the new read, cancellation, abort and blob-reader failure cases. This suite exercises the real ZIP dependency; the complete WASM conversion suite was not run.

The new regression fails against the original behavior and passes with this fix. Whitespace and repository conventions checks pass. Full runtime/title execution and Windows/Linux execution were not performed locally.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are documented where required
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (OpenAI Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4887737522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6780). Originally posted by [MrMha](https://github.com/MrMha) on 2026-10-16T11:31:38Z. --- ### What When a directory-output read fails, cancelling an already errored ReadableStream rejects. That rejection previously skipped output abort; a cancellation or abort failure could also replace the original conversion error. Settle both cleanup operations before rethrowing the original failure, and preserve that failure for blob-reader cleanup too. Export the existing writer for direct stream regression coverage. ### Tested macOS 27.0.1 arm64, based on `main` `7dcfff559f68fc4ffb52f836134d3133492a3d00`. The Node archive-root suite passes, including the new read, cancellation, abort and blob-reader failure cases. This suite exercises the real ZIP dependency; the complete WASM conversion suite was not run. The new regression fails against the original behavior and passes with this fix. Whitespace and repository conventions checks pass. Full runtime/title execution and Windows/Linux execution were not performed locally. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; silent stubs are documented where required - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (OpenAI Codex)
MarcZX10 commented 2026-10-16 11:53:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:53:15Z.

Review: APPROVED


The cleanup path waits for both stream cancellation and output abort to settle, then rethrows the original transfer/read error; the blob-reader path preserves it the same way. The regressions cover already-errored input, cancellation and abort failures, lock release, and blob read failure. The focused Web tests, conventions, eligibility, and intake checks pass. I compared the shared test file with #6100: these tests append to its suite without changing its assertions, so the overlap composes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5547408174 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6780#pullrequestreview-5547408174). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T11:53:15Z. **Review:** APPROVED --- The cleanup path waits for both stream cancellation and output abort to settle, then rethrows the original transfer/read error; the blob-reader path preserves it the same way. The regressions cover already-errored input, cancellation and abort failures, lock release, and blob read failure. The focused Web tests, conventions, eligibility, and intake checks pass. I compared the shared test file with #6100: these tests append to its suite without changing its assertions, so the overlap composes.
github-actions[bot] commented 2026-10-19 05:47:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T05:47:23Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 7332 demo/web/archive.mjs
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6260595073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6780#issuecomment-6260595073). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T05:47:23Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `demo/web/archive.mjs` |
adriadam10 commented 2026-10-19 10:35:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T10:35:27Z.


Checked the cleanup change in DirectoryWriter (stream and blob paths): the original error is rethrown, and the new tests fail against the previous behaviour. Merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6265237185 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6780#issuecomment-6265237185). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T10:35:27Z. --- Checked the cleanup change in `DirectoryWriter` (stream and blob paths): the original error is rethrown, and the new tests fail against the previous behaviour. Merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6780
No description provided.