Open anmol-tray opened 1 week ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi @anmol-tray could you give some more context on why you believe this is a bug? It seems that the cancellation handling of suspendCancellableCoroutine
could be an enhancement, but are you running into problems with this code as is?
Hi @anmol-tray could you give some more context on why you believe this is a bug? It seems that the cancellation handling of
suspendCancellableCoroutine
could be an enhancement, but are you running into problems with this code as is?
Yes because when we cancel a coroutine using a job.cancel the suspendCoroutine doesn't cancel the revenueCat call.. but wrapping the normal non suspend function for get current customer in my own suspendCancellableCoroutine cancells the coroutine.
Ref:
https://github.com/android/codelab-kotlin-coroutines/issues/8
It's important that the coroutine cancels properly with cancellation exception
If you think it's not an issue please feel free to close this issue.
Thanks!
https://github.com/RevenueCat/purchases-android/blob/36ddd195619d39653d40c877d56ac1cefc3a0e92/purchases/src/defaults/kotlin/com/revenuecat/purchases/coroutinesExtensions.kt#L24
it should be suspendCancellableCoroutine instead of suspendCoroutine