-
Notifications
You must be signed in to change notification settings - Fork 674
kotlinx.coroutines.JobCancellationException: Job was cancelled; #2005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For some context, the |
Hey @martinbonnin, looking the changes regarding this issue, the class |
Hi, found the same issue in ApolloCall<>.await(). I think there should be a scope.isActive check. What do you think ? |
@CureleaAndrei can you share your apollo version and the stacktrace? |
@CureleaAndrei Facing the same issue on |
Summary
I am getting a
kotlinx.coroutines.JobCancellationException: Job was cancelled; job=StandaloneCoroutine{Cancelled}
exception when I use thetoFlow
method on the Apollo client.Description
This repo https://github.com/msya/ApolloAndroidPlayground has an example app that shows the problem. I have a repo that creates an Apollo client and uses the
toFlow
extension to get the Flow.I also have a ViewModel that launch a coroutines in the view model scope. In this coroutine, I am collecting from the Flow.
However, if I call cancel on the Job returned by the coroutine. I am getting the cancellation exception -
kotlinx.coroutines.JobCancellationException: Job was cancelled; job=StandaloneCoroutine{Cancelled}
. In the activity below, I am canceling the call explicitly on a button click.I suspect this problem is due to the clone method in the
callbackFlow
in thetoFlow
extension. If you remove the clone method, the exception does not occur.Version
1.3.2
The text was updated successfully, but these errors were encountered: