work_vault 0.5.0
work_vault: ^0.5.0 copied to clipboard
Resumable HTTPS GET downloads for Flutter across Android, iOS, macOS, Windows, Linux, and Web.
0.5.0 #
- Security: the desktop engine (Windows, macOS, Linux) no longer accepts every TLS certificate. It installed a
badCertificateCallbackthat returnedtrue, so a man-in-the-middle could serve any file. Certificates are now checked against the platform trust store, and a download from a server with an untrusted or self-signed certificate fails. - Add
WorkTaskConfig.expectedSha256. Windows, macOS, Linux and the web now hash the completed file and compare it with this digest, or with theX-Work-Vault-Sha256header. A mismatch ends the task asfailedwith the failure codechecksumand is not retried. On Android the value is passed to the existing native verifier through that header. iOS does not check it yet. A malformed digest, or a field and header that disagree, now failsvalidate. - Fix iOS, desktop and web sending the local
X-Work-Vault-Sha256andX-Work-Vault-Md5headers to the server. - Fix desktop and web
getTaskandgetTasksreporting every failure with the generic codefailed. The failure's code, message, HTTP status andretryableflag are now stored with the task, sochecksum,http_404and the rest survive a read and an app restart. A row that failed before this version still reads asfailed. - The task database moves to schema version 2, which adds the failure columns. Older files are upgraded when opened and keep their rows. An older version of the package refuses a version 2 file, so downgrading after the upgrade needs the database to be deleted.
- Web: hash the download chunk by chunk as it arrives, and keep the received chunks instead of one
List<int>. The finished file is no longer copied into one buffer before it is hashed and saved. - Update
pigeonto 30.0.4 (pinned) and regenerate the Dart, Kotlin, and Swift bindings. The wire format is unchanged. The Kotlin enum lookups now index the cached enum values byraw. - Example app: rebuilt as a small download manager on
package:material_ui. It restores tasks on launch, offers pause, resume and cancel only whennextTaskStatusallows them, shows progress, failures and completed-file details with an on-demand SHA-256, and adds a new-download form for network, battery and retry options. No plugin API changes.
0.4.1 #
- Republish of 0.4.0, which was retracted. There are no code changes.
0.4.0 #
- Breaking (pre-1.0 API trim):
package:work_vault/work_vault.dartno longer exportsworkVaultBackgroundChannel,workVaultBackgroundEntrypoint,workVaultBackgroundLibraryorregisterWorkVaultBackgroundHandler. The native hosts carry their own copy of those names, andWorkVault.registerBackgroundHandleris the supported way to register a handler.workVaultBackgroundMainstays exported. To migrate, replaceregisterWorkVaultBackgroundHandler(handler)withWorkVault.registerBackgroundHandler(handler); the removed constants have no replacement because they only describe the native host contract. - Update
pigeonto 29.1.0 (pinned) and regenerate the Dart, Kotlin, and Swift bindings. The wire format is unchanged. - Enable stricter lints (
always_declare_return_types,avoid_dynamic_calls,cancel_subscriptions,directives_ordering,prefer_final_in_for_each,prefer_single_quotes,unnecessary_lambdas) and fix what they reported. - Add a tag-triggered release workflow (pub.dev automated publishing),
CODE_OF_CONDUCT.md,SUPPORT.md,CODEOWNERS, and a stability and scope section in the README. - Document every public member and enforce it with the
public_member_api_docslint. - Fix the iOS podspec version, which still said 0.1.0, and add
tool/check_versions.dart, which CI runs to keep the pubspec, podspec, changelog and example lockfile versions in agreement. - Add
homepageand more specifictopicsto the pub.dev listing. - README no longer points users at a
src/import for the background entrypoint. - Replace the boilerplate example README and repair the garbled Pigeon instructions in
CONTRIBUTING.md.
0.3.2 #
- Web: Persist
TaskStatus.runningto the task store onstartandresumesogetTaskimmediately reflects the active state. - Update
pigeonto 29.0.11 and regenerate typed platform IPC bindings for Dart, Kotlin, and Swift. - Move browser test suites to
test/web/for consistent CLI and CI test execution. - Synchronize example lockfile with root package version.
0.3.1 #
- Android: Update
kotlin-gradle-pluginto 2.4.21. Keepandroidx.core:core-ktxon 1.16.0 for Android API 36 compatibility. - Fix Chrome web test suite location so
flutter test --platform chromeresolves correctly in CI.
0.3.0 #
- Add macOS support. It uses the desktop engine, which already selected itself on macOS but was never declared or tested. The README documents the
com.apple.security.network.cliententitlement a sandboxed app needs. - Fix
WorkVault.enqueueoverwriting a newer status. A host that starts work immediately, such as the desktop engine, reportsrunningbeforeenqueuereturns itsenqueuedsnapshot, and the vault then showedenqueuedwhile bytes were flowing, sopausewas rejected as an illegal transition. - Web:
resumecontinues a paused download withRange/If-Rangeinstead of refetching from byte 0, restarts on a changedETagor416, and sendsWorkTaskConfig.headers(previously ignored on web). - Add CI (analyze, format, unit, web, Android, iOS, Pigeon drift), Dependabot, issue and PR templates,
SECURITY.md, andCONTRIBUTING.md. - Document per-platform guarantees in the README.
- Format the Dart sources with
dart format. - The example app builds and runs on macOS, and its end-to-end test uses a unique task id per run, because the desktop task store persists between runs.
0.2.1 #
- Add screenshots to the pub.dev listing: how it works, the task lifecycle, and a quickstart.
0.2.0 #
- Add official support for Windows, Linux, and Web.
- Add
DesktopWorkVaultEngine(dartPluginClass) for Windows and Linux with resumable HTTP GET streaming viaRange: bytes=X-headers, SHA-256 integrity verification, and SQLite database persistence. - Add
WebWorkVaultEngine(flutter_web_plugins) for Web with Fetch/Streams API chunk streaming, progress observation, web database persistence, SHA-256 checks, and automatic browser file download triggers. - Implement web-safe abstractions and conditional imports across storage and file hashing layers to prevent
dart:iocompilation errors on Web. - Scaffold native runners for Windows, Linux, and Web in the
example/application with dynamic cross-platform destination paths. - Fix every Flutter app build failing in the generated plugin registrant:
WorkVaultLinuxandWorkVaultWindowsare now exported frompackage:work_vault/work_vault.dart, which is where the registrant imports them from. The export is skipped on web. - Carry the schema version and close-on-error handling into the IO database implementation introduced for desktop support.
- Add iOS tests for retry exhaustion, cancel cleanup, battery gating, and the network-constraint mapping. The cellular and expensive-path settings now come from one function that the background session configuration uses.
- Fix the iOS plugin not compiling:
WorkVaultSessionManager.readnow rethrows, so a lookup of an unknown task reportstask_not_foundinstead of failing the build. - Document how to run the Dart, Android, and iOS test suites.
- Add Android tests that pin entity-tag restart, redirect limits, cleartext refusal, timeouts, and retryable HTTP statuses.
- Record a schema version in the shared SQLite file. A file written by 0.1.0 keeps its rows, and a file from a newer version is refused with a
StateErrorinstead of being misread. - Fix the headless background engine reusing the first database it opened. Each dispatched event is now written to the database its payload names.
- Remove the Android TUS upload handler. Version 1 runs resumable HTTPS GET only, so native routing and validation now reject every other method, with or without upload protocol headers.
- Fix Android so an expected digest passed in
X-Work-Vault-Sha256orX-Work-Vault-Md5is no longer replaced by the server'sDigestorContent-MD5response header. A server digest is used only when none was supplied, including when a stored task is resumed. - Document expected-digest verification, including that iOS does not read these headers yet.
- Lower the Dart SDK constraint to
^3.13.0so it matches the documented minimum of Dart 3.13 and Flutter 3.47. The previous^3.13.4required Flutter 3.47.7.
0.1.0 #
- Support one transfer: a resumable HTTPS GET. Android runs it in WorkManager. iOS runs it in a background URLSession. Any other method is rejected.
- Keep the download running after the UI isolate is gone. A headless Flutter engine receives progress and completion and writes the SQLite projection.
- Treat the native store as the authority for status, byte count, entity tag, and resume position.
initializereloads that state. - Decide
completedorfailedin the native checksum verifier. Dart recordsverified,mismatch, ormissingand does not change that status. - Deliver Android status and progress on the platform main thread while the UI engine is attached.
0.0.1 #
- Add the Pigeon host contract and the typed Dart control plane for background downloads.
- Deliver background events through a headless Flutter engine when the UI engine is gone, and store task rows, resume tokens, and SHA-256 status in SQLite.
