Skip to content

fix(apps:liveupdates:upload): report files that vanish while zipping as user error - #254

Merged
robingenz merged 1 commit into
mainfrom
fix/zip-vanished-file-error
Oct 21, 2026
Merged

robingenz merged 1 commit into
mainfrom
fix/zip-vanished-file-error

Conversation

@robingenz

Copy link
Copy Markdown
Member

Summary

When apps:liveupdates:upload zips a folder, adm-zip first lists all files and reads them afterwards. If another process (e.g. cap sync or a build running in parallel) removes a file in between, the command failed with the raw ADM-ZIP: File not found message. The error has no error code and was also reported as an unexpected error.

This PR translates that case into a UserError with the same wording the manifest upload path already uses:

The file could not be read: <path>. Make sure that no other process (e.g. a build or file sync client) modifies the folder while the command is running.

Changes

  • src/utils/zip.ts: zipFolder catches the file-not-found error from adm-zip, extracts the path and throws a UserError. Other errors are rethrown unchanged.
  • src/utils/file.ts: new createUnreadableFileError helper, shared by readFileFromDirectory and zipFolder.
  • src/utils/zip.test.ts: tests for the translated error and for rethrowing other errors.

🤖 Generated with Claude Code

…as user error

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@robingenz robingenz added the bug/fix Something isn't working label Oct 21, 2026
Copilot AI balanced review requested due to automatic review settings October 21, 2026 05:56
@robingenz robingenz added the bug/fix Something isn't working label Oct 21, 2026
@robingenz robingenz self-assigned this Oct 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes preserve unrelated error handling and include targeted tests, with no unresolved findings.

No open issues 🎉

What changed in this PR

Improves live-update uploads by reporting files that disappear during zipping as actionable user errors.

Changes:

  • Translates the specific adm-zip file-not-found error while preserving unrelated errors.
  • Shares unreadable-file error formatting with manifest uploads.
  • Adds tests for error translation and fallback behavior.
File Description
src/​utils/​zip.ts Converts vanished-file errors into user errors.
src/​utils/​zip.test.ts Tests translated and unrelated errors.
src/​utils/​file.ts Exports shared error formatting and guidance.

Review effort: Balanced

@robingenz
robingenz merged commit 9284255 into main Oct 21, 2026
4 checks passed
@robingenz
robingenz deleted the fix/zip-vanished-file-error branch October 21, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug/fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants