Hello 馃憢 .
I have a request that needs to be retried when there's a failure:
apolloClient
.query(MyAwesomeQuery())
.toFlow()
.retry(retries = MAX_RETRY_COUNT)
.flowOn(dispatcher)
However, retrying the request results in an IllegalStateException "Already Executed" error from Retrofit which is expected since a Retrofit call can only be executed once. When I add clone() to the request, I still get the same error.
apolloClient
.query(MyAwesomeQuery())
.clone()
.toFlow()
.retry(retries = MAX_RETRY_COUNT)
.flowOn(dispatcher)
What is the expected behavior for ApolloQueryCall.clone()?
I'm not able to add a label, but this is a question.
Looks like we need to do ApolloCall.clone inside the flow creation:
fun <T> ApolloCall<T>.toFlow(capacity: Int = Channel.UNLIMITED) = flow {
...
clone().enqueue(ChannelCallback(channel = channel))
I will take this issue.
Most helpful comment
I will take this issue.