kotlinx.coroutines v1.11.0 Release Notes

Release Date: 2026-05-08 // 2 months ago
  • Various

    • โšก๏ธ Kotlin was updated to 2.2.20 (#4545).
    • ๐Ÿ‘Œ Improved the published jar files (#3842, #4599).
    • ๐Ÿ“š Various documentation improvements, including complete rewrites of structured concurrency and error handling-related KDoc (#4433, #4596).

    ๐Ÿ’ฅ Breaking changes and deprecations

    • ๐Ÿšš Moved Promise-related functions from JS and Wasm/JS to the new web target. On Wasm/JS, this is a breaking change. Before the change, Promise on Wasm/JS could work with arb
      itrary Kotlin types, but now, only JsAny subtypes are accepted (#4563).
    • ๐Ÿ”„ Changed handling of coroutine exceptions that can't be propagated on JS and Wasm/JS. B
      efore, exceptions were logged, but now, they are reported to the JS runtime (#4451, #4631).
    • ๐Ÿ—„ Deprecated using CoroutineDispatcher as the coroutine context key; now, ContinuationInterceptor has to be used instead (#4333).
    • โœ… Advanced the deprecation levels on kotlinx-coroutines-test APIs (#4604).
    • โž• Added lint functions that mark passing a Job to coroutine builders as deprecated (#4435).

    ๐Ÿ› Bug fixes and improvements

    • โž• Added a callsInPlace(EXACTLY_ONCE) contract to runBlocking in code shared between JVM and Native (#4368).
    • โž• Added a callsInPlace(EXACTLY_ONCE) contract to suspendCancellableCoroutine (#4574).
    • ๐Ÿ›  Fixed flowOn incorrectly handling ThreadContextElement updates (#4403).
    • ๐Ÿ›  Fixed exceptions in user-supplied Thread.UncaughtExceptionHandler instances causing the internal coroutines machinery to fail (#4516).
    • ๐Ÿ›  Fixed CoroutineDispatcher.asScheduler in the RxJava integration not cancelling outstanding work when a Worker gets cancelled, which led to memory leaks in some scenarios (#4615).
    • ๐Ÿ›  Fixed SharedFlow entering an invalid state when a subscriber and an emitter are cancelled simultaneously (#4583).
    • ๐Ÿ›  Fixed an R8 optimization leading to shareIn/stateIn coroutines getting garbage-collected (#4646). Thanks, @solevic!

    Small additions

    • โž• Added CompletableDeferred.asDeferred for obtaining a read-only Deferred view (#4408).
    • โž• Added SharedFlow.asFlow for obtaining a Flow view with hidden hot flow semantics (#4530). Thanks, @g000sha256!
    • โž• Added a StateFlow.collectLatest overload returning Nothing to assist with finding unreachable code (#4454).
    • โž• Added ReceiveChannel.consumeTo for consuming a ReceiveChannel into a MutableCollection (#4520).
    • โž• Added a StateFlow<T>.onSubscription overload returning a StateFlow<T>, similar to SharedFlow<T>.onSubscription returning SharedFlow<T> (#4275). Thanks, @xit0c!
    • โž• Added terminal Flow operators for collecting a Flow to a Map (#1541).

    ๐Ÿ”„ Changelog relative to version 1.11.0

    No changes, only the version is increased.


Previous changes from v1.11.0-rc02

  • โช Restored binary compatibility with 1.10.2 and older versions on Wasm/JS for usages of Promise-related functions (#4661).