offline_upload_queue 0.6.0 copy "offline_upload_queue: ^0.6.0" to clipboard
offline_upload_queue: ^0.6.0 copied to clipboard

Offline-first image upload queue for Flutter — persistent, retry-capable, background-aware.

0.6.0 #

Breaking Changes #

  • API Değişikliği: PersistenceRepository.enqueue imzasından sequenceNumber parametresi kaldırıldı. Sequence numarası artık repository tarafından (transaction içerisinde güvenli şekilde) otomatik üretiliyor. Özel PersistenceRepository implementasyonlarının enqueue imzalarını güncellemeleri gerekir.
  • PersistenceRepository.init() artık crash recovery yapmaz; recoverStuckUploads() worker kilidi alındıktan sonra çağrılmalıdır (çift yükleme yarışını önlemek için). QueueController bunu otomatik yönetir.
  • retry() / purge() yalnızca permanentlyFailed / cancelled görevleri kabul eder; aksi halde StateError.
  • Özel PersistenceRepository implementasyonları için yeni üyeler: getTask, hasProgressListener, getNextPending(..., onlyTaskIds:).

Bug Fixes #

  • dispose() sonrası init() artık çalışır (late final kaldırıldı).
  • BackgroundTaskRunner paylaşılan (iOS) kuyruğu dispose etmez; abortActiveUploads() eklendi.
  • watchProgress dinleyici varken gerçekten onProgress bağlanır.
  • cancel() / dispose() sonrası adapter failure dönüşü görevi failed ile ezmez.
  • updateHeartbeat yalnızca kilit sahibi için yazar.
  • forceUploadOnce öncelik açlığı giderildi; pause()/resume() watchSummary abonelerini günceller.
  • Sequence üretimi O(1) meta sayaç kullanır; yayın arşivinden build/ ve geçici kök dosyalar çıkarıldı.

0.5.1 #

Fixes & Improvements #

  • Performans: Büyük dosyalarda (örn. 50MB+) enqueue işlemi sırasında oluşan RAM spike'ı önlemek için checksum hesaplaması streaming (chunked SHA-256) kullanacak şekilde güncellendi.
  • Hafıza: Tamamlanan (completed, cancelled, permanentlyFailed) görevlerde progress stream controller'larının map'te birikmesine neden olan hafıza sızıntısı giderildi.
  • Güvenilirlik: Dosyaların sandbox dizinine kopyalanması sırasında dosya uzantısının hesaplanmasındaki bir kırılganlık (path paketi kullanılarak) giderildi.

0.5.0 #

Breaking Changes #

  • Persistence backend değişti: SQLite/Drift'ten sembast'a geçildi.
    • Native binary bağımlılığı (sqlite3_flutter_libs) kaldırıldı — pure-Dart backend.
    • drift ve sqlite3_flutter_libs bağımlılıkları kaldırıldı.
    • build_runner / drift_dev artık gerekmiyor — codegen adımı yok.
    • database.dart ve tables.dart public export'tan kaldırıldı; SembastPersistenceRepository export edildi (ileri düzey kullanım için).
  • PersistenceRepository interface'i değişmedi — özel implementasyonlar etkilenmez.

Encryption (Uyarı ile) #

  • encryptionKey parametresi artık sembast'ın codec mekanizmasına bağlı. Önemli: Kullanılan codec (Salsa20+SHA256), sembast kaynak deposundaki örnek bir implementasyondur ve bağımsız güvenlik denetiminden geçmemiştir. Compliance gerektiren kullanım senaryoları için bağımsız denetlenmiş bir şifreleme çözümü tercih edin.

0.4.0 #

Security #

  • Encryption Support: Added encryptionKey option to UploadQueue allowing the database to be fully encrypted at rest (typically requires a federated SQLCipher package like sqlcipher_flutter_libs).
  • Metadata Encryption: Added MetadataCodec interface to UploadQueue for encrypting only PII data inside metadata fields without encrypting the entire database.

0.3.0 #

Performance #

  • Event-Based Lock Takeover: QueueController now listens to SQLite lock table updates (tableUpdates) to immediately resume uploads when a worker releases a lock, eliminating the default 30s polling delay in multi-isolate setups.
  • Adaptive Polling: In background execution contexts with short deadlines (e.g. iOS BGTaskScheduler), the polling interval is adaptively reduced to prevent missing the execution window.

0.2.0 #

Performance #

  • Zero-Copy Sandbox: copyToSandbox now attempts to use hardlinks (ln) first on compatible filesystems to eliminate disk I/O and duplication overhead.
  • Streaming Copy: Introduced sandboxCopyThresholdBytes in UploadQueueAdvancedOptions. Files larger than this threshold fallback to an asynchronous chunked streaming copy instead of blocking File.copy(), saving memory on large files.

0.1.0 #

Initial public release.

Features #

  • Offline-first persistent upload queue backed by SQLite (via Drift).
  • Sequential processing with configurable maxAttempts and exponential backoff retry (BackoffStrategy.exponential / BackoffStrategy.fixed).
  • Wi-Fi only mode (wifiOnly: true) with cellular override via forceUploadOnce().
  • Reactive streams: watchSummary(), watchTasks(), watchProgress().
  • Disk usage tracking: estimatedDiskUsageBytes and configurable onDiskUsageWarning callback.
  • SHA-256 checksum verification against optional server-side checksum.
  • copyToSandbox: true (default) — files are copied to a package-managed sandbox directory on enqueue so originals can be deleted safely.
  • Stale-lock recovery: uploading → pending on restart after crash.
  • Worker heartbeat and atomic lock acquisition (SQLite single-writer guarantee).
  • iOS background sync via BGTaskScheduler (IosBackgroundChannel).
  • Android background sync via Workmanager (AndroidBackgroundRunner).
  • Pluggable UploadAdapter interface (default: RestUploadAdapter with Dio).
  • Pluggable ConnectivityMonitor interface (default: DefaultConnectivityMonitor with reachability test).
  • Pluggable PersistenceRepository interface for custom storage backends.
  • onAuthExpired callback for token-refresh integration.
  • onLog hook for routing internal events to Sentry / Crashlytics.
  • Multiple independent queues via boxName parameter.
3
likes
160
points
173
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Offline-first image upload queue for Flutter — persistent, retry-capable, background-aware.

Repository (GitHub)
View/report issues
Contributing

Topics

#flutter #upload #offline-first #queue #sembast

License

MIT (license)

Dependencies

connectivity_plus, crypto, dio, encrypt, flutter, path, path_provider, sembast, uuid, workmanager

More

Packages that depend on offline_upload_queue