Bug Fixes
-
Fix stacked-params lookup on linked scopes (#2387) — The 4.2.0 resolver rewrite (
CoreResolverV2) walked linked scopes but dropped the per-parent stacked-parameters check that 4.1.x performed via recursion. This broke patterns whereAndroidParametersHolderis stacked on the factory scope byKoinViewModelFactoryandSavedStateHandleis then resolved from a child ViewModel scope. Linked-scope resolution now also checks stacked params on each parent scope. -
Restore ABI compatibility for
runOnKoinStarted(#2391) — The 4.2.0 release inadvertently broke binary compatibility forrunOnKoinStartedon JVM. Fixed by restoring the original JVM class name via@JvmName/@JvmMultifileClassannotations. -
Fix scope
_closedconcurrency issue (#2389) — TheScope._closedflag was not volatile, which could cause stale reads under concurrent access.
Improvements
-
Improved Scope resolution error messages —
CoreResolverV2now provides clearer error messages when scope resolution fails, making it easier to diagnose misconfigured scopes. -
Added
apiCheckto CI — Binary compatibility validation (kotlinx.binary-compatibility-validator) now runs on every PR to prevent future ABI breaks.
Documentation
parametersOftype-collision warning (#2328) — Added a caution note explaining that when a value passed viaparametersOfhas the same type as the requested definition, Koin returns the value directly and skips the factory block. Suggests using a wrapper type as a workaround.
Contributors
Thanks to the following contributors for this release:
- @arnaudgiuliani (Arnaud Giuliani)
- @inemtsev (Ilya Nemtsev) — fix for scope closed concurrency issue (#2389)