Skip to content

fix(task) #17 ZipTask and UnzipTask no longer ignore write failures - #21

Merged
njoubert-cleverage merged 1 commit into
16from
17
Sep 30, 2026
Merged

njoubert-cleverage merged 1 commit into
16from
17

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #17. Based on #20 (merge #19 and #20 first, this PR will then target main).

ZipTask and UnzipTask ignored the result of ZipArchive::close() (which writes the archive) and ZipArchive::extractTo(): in production (PHP warnings only logged), a write failure passed silently and the task output the path anyway. In debug mode, the task failed with a raw PHP warning.

  • ZipTask: throw a \RuntimeException when close() fails (Unable to write zip file <filename>: <ZipArchive status>)
  • UnzipTask: throw a \RuntimeException when extractTo() fails (Unable to extract file <filename> to <destination>: <PHP error>, ZipArchive gives no status for this failure); the open failure message now gives the ZipArchive error code, as ZipTask does
  • the PHP warnings of these two calls are silenced (@), the exceptions carry their message
  • ZipTaskTest, UnzipTaskTest: missing parent directory, destination being a file, file that is not a zip archive (fail without the fix)
  • zip_task.md, unzip_task.md: document these failures

Checked with --no-debug in process-bundle-demo: demo.archive.zip_write_failure and demo.archive.unzip_write_failure now fail with the exceptions above (they succeeded and output the path before), demo.archive.unzip_not_a_zip fails with Unable to open file .../sample.txt with code 19.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

A write / extraction failure now fails the task (with the default stop strategy, the process fails) instead of being silently ignored in production.

🤖 Generated with Claude Code

… archive cannot be written or extracted, UnzipTask gives the ZipArchive error code on open failure

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage njoubert-cleverage added the bug Something isn't working label Sep 30, 2026
@njoubert-cleverage njoubert-cleverage self-assigned this Sep 30, 2026
@njoubert-cleverage
njoubert-cleverage merged commit 0fa7fe8 into 16 Sep 30, 2026
17 checks passed
njoubert-cleverage added a commit that referenced this pull request Sep 30, 2026
…stacked base branches)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant