Tim Malseed
11/11/2020, 6:41 AMJobCancellationException. My crash reporting tool isn't offering any useful information, and I don't quite understand this exception..Tim Malseed
11/11/2020, 6:41 AMkotlinx.coroutines.JobCancellationException · Job was cancelled
unknown fileunknown methodTim Malseed
11/11/2020, 6:42 AMMainActivity.onDestroy() is called in my Android app. So presumably, someone is swiping the app away from recents (potentially killing the app process)Tim Malseed
11/11/2020, 6:44 AMCoroutineScope(Dispatchers.Main + job + coroutineExceptionHandler)
Where:
job is a SupervisorJob, and
coroutineExceptionHandler is an instance of CoroutineExceptionHandler that logs errorsTim Malseed
11/11/2020, 6:46 AMelizarov
11/11/2020, 6:48 AMTim Malseed
11/11/2020, 6:48 AMTim Malseed
11/11/2020, 6:50 AMlouiscad
11/11/2020, 7:36 AMChannel and the offer function?Tim Malseed
11/11/2020, 9:56 PMlouiscad
11/12/2020, 10:01 AMconsume, consumeEach or consumeAsFlow() when, respectively, you should not, when you should use a plain for loop or receive(), or when you should use receiveAsFlow()
• because you have a race condition, for example in `callbackFlow`/`channelFlow` or elsewhere, which is this issue: https://github.com/Kotlin/kotlinx.coroutines/issues/974
• because you close or cancel the channel in a way or another, where a JobCancellationException is passed as a cause.Tim Malseed
11/12/2020, 12:40 PM