Skip to content

v2.5.1 — Documentation Hotfix

Choose a tag to compare

@vietnguyentuan2019 vietnguyentuan2019 released this 20 May 04:42
· 181 commits to main since this release

What changed

This is a docs-only patch release. No API changes, no behavior changes — all existing code continues to work identically.

Fixed

Five documentation errors that caused copy-paste code from the guides to fail to compile (Issue #32):

Doc Problem Fix
README.md, docs/quickstart.md @KmpWorker annotation shown — does not exist Corrected to @Worker(name = "...") from kmpworker-annotations
docs/quickstart.md iOS Koin init called KoinIOSKt.doInitKoinIos() — function does not exist Corrected to KoinInitializerKt.doInitKoin(platformModule: IOSModuleKt.iosModule)
docs/platform-setup.md §6 Worker implementation showed pre-library CoroutineWorker pattern incompatible with current API Replaced with AndroidWorker + @Worker(name = ...) pattern
docs/examples.md WorkerResult.Failure(...) // Retry with backoff — Failure does not retry by default Corrected to WorkerResult.Retry(reason = ...)
docs/quickstart.md, docs/platform-setup.md Android init used deprecated startKoin { kmpWorkerModule() } Replaced with KmpWorkManager.initialize(context, workerFactory)

Important note on @Worker(name = ...)

The name argument is required for production safety. It must match the workerClassName you pass to scheduler.enqueue(...). If you omit it, the KSP processor defaults to the class simple name and emits a warning — this breaks silently after ProGuard/R8 rename or class refactoring.

// androidMain
@Worker(name = "SyncWorker")   // ✅ stable key — survives rename/obfuscation
class SyncAndroidWorker : AndroidWorker { ... }

// iosMain
@Worker(name = "SyncWorker", bgTaskId = "com.example.sync-task")
class SyncIosWorker : IosWorker { ... }

Upgrade from v2.5.0

No code changes needed. This release only fixes documentation.

// libs.versions.toml
kmpworkmanager = "2.5.1"

Full migration guide: docs/MIGRATION_V2.5.0.md (unchanged from v2.5.0)