Skip to content

feat: expose SNI file upload progress - #265

Draft
huhuanming wants to merge 2 commits into
mainfrom
codex/sni-upload-progress
Draft

huhuanming wants to merge 2 commits into
mainfrom
codex/sni-upload-progress

Conversation

@huhuanming

@huhuanming huhuanming commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Why

Log uploads had no interim progress while the existing uploadFile(config) Promise was pending.

What changed

  • Added getUploadProgress(requestId): Promise<{ bytesSent, totalBytes } | null> to the matching JS and native module. It returns null when that module has no active snapshot for the ID. The existing uploadFile arguments, response, timeout, security, and fallback behavior remain unchanged.
  • Kept snapshots per native module and request operation. Cancellation, settlement, invalidation, and duplicate request IDs remove or isolate the previous snapshot.
  • iOS uses EMASCurl 1.5.5's per-request upload callback; Android counts payload bytes accepted by the OkHttp sink. These are sender-side counts, not server acknowledgements. The spec documents each platform's internal retry semantics.
  • Updated both SNI specs and added focused JS, Android, and iOS tests.

Validation

  • TypeScript typecheck passed.
  • React Native Codegen parsed the TypeScript schema and generated Android JavaSpec and iOS ObjCpp bindings in memory.
  • JS Jest suite passed: 10/10 tests.
  • ESLint: 0 errors; 4 pre-existing no-void warnings.
  • Prettier check and git diff --check passed.
  • The Android unit/build CI job passed. iOS native build and device/network acceptance remain unverified on this Windows host.

Coordinated release

Ship this native module change together with OneKeyHQ/app-monorepo#14532. The JS and native progress methods must be present in the same app release. Native package publication, the app's package version pin update, and an app rebuild are required rollout steps; this PR does not publish or bump a version.

This branch has not been deployed

No deployments
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