Motivation
Large archives can run for a long time with no way to abort. Competitors (react-native-nitro-unzip, react-native-unarchive) already expose cancellation. Error handling is also inconsistent across platforms (generic messages, historically null codes), which makes UI branching hard.
Proposal
cancel(): Promise<void>
Cancel the in-flight zip/unzip operation (best-effort). Reject the active promise with a stable CANCELLED code. Clean up partial output where practical.
Stable error codes
Reject with a consistent code string on both platforms, e.g.:
| Code |
When |
ERR_FILE_NOT_FOUND |
Source missing |
ERR_INVALID_PATH |
Bad destination / empty path |
ERR_WRONG_PASSWORD |
Password decrypt failed |
ERR_CORRUPT_ARCHIVE |
Not a zip / truncated / bad CRC |
ERR_UNSAFE_PATH |
Zip Slip / symlink escape |
ERR_CANCELLED |
User cancelled |
ERR_BUSY |
Operation rejected because another is running (if serialized) |
ERR_ZIP / ERR_UNZIP |
Generic fallback |
Acceptance criteria
Priority
P0
Motivation
Large archives can run for a long time with no way to abort. Competitors (
react-native-nitro-unzip,react-native-unarchive) already expose cancellation. Error handling is also inconsistent across platforms (generic messages, historically null codes), which makes UI branching hard.Proposal
cancel(): Promise<void>Cancel the in-flight zip/unzip operation (best-effort). Reject the active promise with a stable
CANCELLEDcode. Clean up partial output where practical.Stable error codes
Reject with a consistent
codestring on both platforms, e.g.:ERR_FILE_NOT_FOUNDERR_INVALID_PATHERR_WRONG_PASSWORDERR_CORRUPT_ARCHIVEERR_UNSAFE_PATHERR_CANCELLEDERR_BUSYERR_ZIP/ERR_UNZIPAcceptance criteria
cancel()stops in-flight zip and unzip on iOS and AndroidERR_CANCELLEDPriority
P0