Lubomir Pisk

02/16/2023, 1:50 PM
Hello, I am using Ktor client in an android app. My network request is called from Flow.flatMapLatest, when a new item is emitted from upstream the inner flow with API call is cancelled (lambda inside flatMapLatest) and kotlinx.coroutines.flow.internal.ChildCancelledException: Child of the scoped flow was cancelled is thrown. I checked that this problem occurs only when two items from upstream are sent immediately (in milliseconds). Is possible that calling HttpSendInterceptor causes this exception? I have about 15 different interceptors. I need cancelation for old API call without exception.

Aleksei Tirman [JB]

02/20/2023, 11:47 AM
Could you share some code to illustrate your issue?