quantum_upload 1.0.0 copy "quantum_upload: ^1.0.0" to clipboard
quantum_upload: ^1.0.0 copied to clipboard

A pure Dart package for reliable chunked file uploads with automatic resume, persistent session tracking, integrity verification, and seamless recovery from network interruptions.

Changelog #

All notable changes to quantum_upload are documented in this file.

The format follows Keep a Changelog and this project adheres to Semantic Versioning.


1.0.0 β€” 2026-05-30 #

πŸŽ‰ Initial stable release #

Added

Core upload engine

  • Uploader β€” main orchestrator class with start(), pause(), resume(), cancel(), and dispose().
  • Uploader.upload() β€” static convenience factory for one-liner usage.
  • stateStream β€” broadcast Stream<UploadState> for UI state binding.
  • progressStream β€” broadcast Stream<ProgressSnapshot> with speed and ETA.

Chunking

  • ChunkManager β€” splits files into configurable byte ranges using RandomAccessFile for memory-efficient reading.
  • ChunkManager.estimateChunkCount() β€” static helper for pre-flight UI labels.
  • ChunkManager.lastChunkSize() β€” static remainder calculator.

Session management

  • UploadSession β€” full per-chunk state tracking; serialises to/from JSON.
  • UploadSession.restore() β€” resumes a session from any SessionStorage.
  • Auto-delete session on successful completion; session survives app kill.

HTTP transport

  • UploadRequest β€” builds and sends multipart/form-data POST with library headers: X-Session-Id, X-Chunk-Index, X-Total-Chunks, X-Chunk-Checksum, X-File-Size, Content-Range.

Retry logic

  • RetryPolicy β€” exponential back-off: delay_n = baseDelay Γ— 2^(nβˆ’1), capped at 30 seconds.
  • RetryPolicy.executeChunk() β€” HTTP-aware variant that skips retries on 4xx errors (client errors are not transient).

Progress tracking

  • ProgressTracker β€” EMA-smoothed speed estimate (configurable Ξ±), ETA derivation, ProgressSnapshot stream.
  • ProgressSnapshot β€” immutable value object with speedMbps, etaFormatted, uploadedFormatted, totalFormatted, remainingBytes.

Models

  • UploadConfig β€” immutable, copyable configuration with copyWith().
  • UploadState β€” 8-value enum with .label, .isActive, .isTerminal, .canResume extensions.
  • ChunkInfo β€” immutable byte-range record with JSON round-trip.
  • UploadResult β€” upload summary: speedMbps, sizeMiB, wasFreshUpload, resumedFraction.

Exceptions

  • UploadException β€” base class carrying message, sessionId, cause.
  • ChunkException β€” adds chunkIndex, statusCode, responseBody, isServerError, isClientError, isNetworkError.
  • SessionException β€” adds isCorrupt flag for version-mismatch detection.

Storage

  • SessionStorage β€” abstract interface for pluggable backends.
  • SharedPrefsStorage β€” default implementation using shared_preferences; includes migrateFrom() helper.
  • InMemorySessionStorage β€” lightweight in-memory implementation for tests.

Tests (100 % coverage)

  • chunk_manager_test.dart β€” 12 test cases covering boundary computation, byte accuracy, checksum correctness, and edge cases.
  • upload_session_test.dart β€” 12 test cases covering getters, mutations, save/restore/delete, and corrupt-data handling.
  • retry_policy_test.dart β€” 10 test cases covering delay formula, should-retry logic, HTTP-aware executor, and back-off behaviour.
  • progress_tracker_test.dart β€” 11 test cases covering percent calculation, stream emissions, speed/ETA, snapshot formatting, and disposal.
  • uploader_test.dart β€” 15 end-to-end test cases using MockHttpClient covering happy path, retries, state transitions, resume, and cancel.
  • mock_http_client.dart β€” fully-featured fake HTTP client with sequence responses, throw-once, fail-then-succeed, and request capture.

Developer tools

  • example/main.dart β€” five runnable examples with terminal progress bar.
  • example/server_example/server.js β€” Node.js reference server with checksum verification, chunk assembly, and session status endpoint.
  • benchmark/upload_benchmark.dart β€” measures split time, read throughput, and MD5 hashing throughput across multiple file/chunk size combinations.
  • doc/getting_started.md β€” comprehensive guide with configuration table, resume flow, custom storage, and FAQ.

0.9.0 β€” 2026-01-01 (beta) #

Added #

  • Initial beta implementation for early-access testing.
  • Basic chunked upload without session persistence.
  • Simple retry loop without exponential back-off.

Known issues (resolved in 1.0.0) #

  • Session not persisted across app restarts.
  • No progress stream; only callback-based progress.
  • Retry delay was constant, not exponential.

0
likes
150
points
6
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A pure Dart package for reliable chunked file uploads with automatic resume, persistent session tracking, integrity verification, and seamless recovery from network interruptions.

Repository (GitHub)
View/report issues

Topics

#upload #file #chunked #resumable #network

License

MIT (license)

Dependencies

crypto, http, path, shared_preferences, uuid

More

Packages that depend on quantum_upload