Skip to content

feat(ffi): upload progress on wallet path + distinct timeout/disk-space errors #214

Open
Nic-dorman wants to merge 2 commits into
mainfrom
feat/ffi-error-handling-progress-0.0.8
Open

feat(ffi): upload progress on wallet path + distinct timeout/disk-space errors #214
Nic-dorman wants to merge 2 commits into
mainfrom
feat/ffi-error-handling-progress-0.0.8

Conversation

@Nic-dorman

Copy link
Copy Markdown
Collaborator

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

Ticket Change
V2-597 Add fileUploadPublicWithProgress / fileUploadPrivateWithProgress — the wallet-backed (built-in payment) counterparts of fileUploadPublic/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; this closes the gap on the wallet path.
V2-599 fileDownloadPublic no longer flattens every ant-core error into NetworkError. It now propagates through the From<ant_core::data::Error> mapping, so a timeout / out-of-disk failure surfaces as its own variant instead of a misleading "network error".
V2-600 Map ant-core Error::InsufficientDiskSpace → new ClientError::InsufficientDiskSpace (previously swallowed by the 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.

Out of scope (need upstream ant-client work)

  • V2-601 insufficient-funds half — ant-core wraps low balance in a generic Payment(String) with no distinct variant. Needs a core InsufficientFunds variant; V2-601 stays open for it.
  • V2-598 cancellation — no CancellationToken on 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 warnings clean
  • cargo test --all — 8 passed
  • Regenerated Swift + Kotlin bindings and confirmed both expose fileUploadPublicWithProgress/fileUploadPrivateWithProgress and the Timeout / InsufficientDiskSpace error 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

@Nic-dorman Nic-dorman changed the title feat(ffi): upload progress on wallet path + distinct timeout/disk-space errors (V2-597/599/600/601a) feat(ffi): upload progress on wallet path + distinct timeout/disk-space errors Jul 14, 2026
Nic and others added 2 commits July 20, 2026 10:31
…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>
@Nic-dorman
Nic-dorman force-pushed the feat/ffi-error-handling-progress-0.0.8 branch from b2b903d to 64469ed Compare July 20, 2026 09:36
@Nic-dorman

Copy link
Copy Markdown
Collaborator Author

Both in-scope misses from the release review addressed in 64469ed (branch also rebased onto current main):

  • wait_for_receipt timeout now returns ClientError::Timeout instead of NetworkError — the most user-visible timeout in the WalletConnect external-signer flow now carries the variant this PR introduced.
  • Download ENOSPC: core Io(StorageFull) from download file writes now maps to ClientError::InsufficientDiskSpace instead of InternalError (guard arm on the From impl; other Io kinds still fall through).
  • Corrected the missing-record mapping note (missing records surface as core InvalidData → FFI InvalidInput at the 0.3.1 pin, not Network; the NotFound arm arrives with the 0.4.x pin bump now that fix(core): type absent records as Error::NotFound (was InvalidData) ant-client#153 is merged).
  • Added From-mapping unit tests (StorageFull → InsufficientDiskSpace, other Io → InternalError, Timeout → Timeout).

Gates on 64469ed: fmt + clippy -D warnings clean, 11/11 tests. No interface change (no new variants), so no binding regeneration needed.

Holding merge pending Nic's go-ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant