Closed
Description
General Info
- I checked for similar bug report
- I am using the latest version
- I checked the troubleshooting page for similar problems
Version(s)
3.1.3
Kotlin Target(s) and their respective versions
All
What happened? (include your code)
I'm getting logged exceptions being handled from cancelled coroutines. Any try/catch containing a suspend call should check for and rethrow CancellationExceptions
.
My code triggering this:
coroutineScope {
val channel = supabase.realtime.channel("db-changes")
channel.postgresChangeFlow<PostgresAction>(schema = "public") {
...
}
.onEach { ... }
.launchIn(this)
channel.subscribe(true)
try {
awaitCancellation()
} finally {
withContext(NonCancellable) {
channel.unsubscribe()
supabase.realtime.removeChannel(channel)
}
}
}
Steps To Reproduce (optional)
No response
Relevant log output (optional)
Unfortunately, I'm not getting the full stacktrace in my logs.
ChildCancelledException: Child of the scoped flow was cancelled