Repository navigation
fix(apps:liveupdates:upload): report files that vanish while zipping as user error - #254
Merged
Merged
Conversation
…as user error Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 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-zipfile-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
apps:liveupdates:uploadzips a folder,adm-zipfirst lists all files and reads them afterwards. If another process (e.g.cap syncor a build running in parallel) removes a file in between, the command failed with the rawADM-ZIP: File not foundmessage. The error has no error code and was also reported as an unexpected error.This PR translates that case into a
UserErrorwith the same wording themanifestupload path already uses:Changes
src/utils/zip.ts:zipFoldercatches the file-not-found error fromadm-zip, extracts the path and throws aUserError. Other errors are rethrown unchanged.src/utils/file.ts: newcreateUnreadableFileErrorhelper, shared byreadFileFromDirectoryandzipFolder.src/utils/zip.test.ts: tests for the translated error and for rethrowing other errors.🤖 Generated with Claude Code