feat(ffi): upload progress on wallet path + distinct timeout/disk-space errors - #214
Conversation
…ce errors Mobile error-handling + progress improvements for the next AntFfi release (no ant-core bump — still 0.3.1 / ant-cli-v0.2.11). - V2-597: add file_upload_public_with_progress / file_upload_private_with_progress, the wallet-backed (built-in payment) counterparts of file_upload_public/private. They bridge ant-core's file_upload_with_progress UploadEvents to the existing ProgressListener (encrypting/quoting/storing phases). The external-signer path already had progress via prepare/finalize_*_with_progress. - V2-599: file_download_public no longer flattens every ant-core error into NetworkError. It now propagates via the From<ant_core::data::Error> mapping, so a timeout / out-of-disk-space failure surfaces as its own ClientError. - V2-600: map ant-core Error::InsufficientDiskSpace to a new ClientError::InsufficientDiskSpace variant (was a catch-all InternalError). - V2-601 (timeout half): Error::Timeout now maps to a dedicated ClientError::Timeout variant instead of being folded into NetworkError with a "timeout:" prefix. The insufficient-funds half needs an upstream ant-client variant (core wraps it in generic Payment) and stays open on V2-601. fmt + clippy -D + 8 tests green; Swift and Kotlin bindings regenerated and verified to expose the new methods and error variants. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…fficientDiskSpace Addresses the two in-scope misses from the release review: - wait_for_receipt now returns ClientError::Timeout (was NetworkError) -- the most user-visible timeout in the WalletConnect external-signer flow - core Io(StorageFull) from download file writes now maps to ClientError::InsufficientDiskSpace (was InternalError) - corrected the missing-record mapping note (InvalidData -> InvalidInput, not Network; the NotFound arm arrives with the 0.4.x pin bump) and added From-mapping unit tests Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
b2b903d to
64469ed
Compare
|
Both in-scope misses from the release review addressed in 64469ed (branch also rebased onto current main):
Gates on 64469ed: fmt + clippy Holding merge pending Nic's go-ahead. |
Panel review — ant-sdk#214Verdict: approve. Severe blockers: none. What it does (verified against PR head
|
|
Thanks for the review. Two notes on the caveats:
Merge remains held for Nic's go-ahead. |
FFI-only mobile error-handling + progress improvements for the next AntFfi 0.0.8 release. No ant-core bump — still ant-core 0.3.1 (
ant-cli-v0.2.11), so nothing on the payment/security surface moves.Changes
fileUploadPublicWithProgress/fileUploadPrivateWithProgress— the wallet-backed (built-in payment) counterparts offileUploadPublic/Private. They bridge ant-core'sfile_upload_with_progressUploadEvents to the existingProgressListener(encrypting/quoting/storingphases). The external-signer path already had progress viaprepare/finalize_*_with_progress; this closes the gap on the wallet path.fileDownloadPublicno longer flattens every ant-core error intoNetworkError. It now propagates through theFrom<ant_core::data::Error>mapping, so a timeout / out-of-disk failure surfaces as its own variant instead of a misleading "network error".Error::InsufficientDiskSpace→ newClientError::InsufficientDiskSpace(previously swallowed by the catch-allInternalError).Error::Timeoutnow maps to a dedicatedClientError::Timeoutvariant instead of being folded intoNetworkErrorwith a"timeout:"prefix.Out of scope (need upstream ant-client work)
Payment(String)with no distinct variant. Needs a coreInsufficientFundsvariant; V2-601 stays open for it.CancellationTokenon core's data upload/download path (only implicit receiver-drop). Rescoped to a download-only investigation.Verification
cargo fmt --all+cargo clippy --all-targets --all-features -D warningscleancargo test --all— 8 passedfileUploadPublicWithProgress/fileUploadPrivateWithProgressand theTimeout/InsufficientDiskSpaceerror variants.Additive uniffi enum change (new variants), so bindings and Rust stay in lockstep per-release; consumers pick it up on the 0.0.8 rebuild.
🤖 Generated with Claude Code