Ran into a strange networking issue. We have our n...
# apollo-kotlin
n
Ran into a strange networking issue. We have our network transport set up as follows:
Copy code
val networkTransport = HttpNetworkTransport(
        connectTimeoutMillis = 5_000,
        readTimeoutMillis = 60_000,
        serverUrl = "${config.serverUrl}/graphql",
        interceptors = listOf(
            BearerTokenInterceptor(tokenProvider = object :
                com.apollographql.apollo3.network.http.TokenProvider {
                override suspend fun currentToken(): String {
                    return config.tokenProvider.currentToken()
                }

                override suspend fun refreshToken(previousToken: String): String {
                    return config.tokenProvider.refreshToken(previousToken)
                }
            })
        )
    )
Specifically note the connect timeout, which differs from the default 60 seconds. This used to work on Android and iOS until migrating to the 3.0.0beta builds. What we discovered today was a particular call, which we know takes a bit over 30 seconds, was failing on iOS, however most of the other mutations we have succeeded. So we tried changing the connectTimeout to 60_000 instead, and that succeeded. I haven't verified, but suspect, this means that the iOS networking call might be using connect timeout instead of read timeout, or something like that. Just thought I'd report it here. Can also report on the github if preferred.
👀 1
m
That rings a bell. The params do not match 1:1 between iOS and Android
Will look into it more tomorrow.
n
Yeah, there's some documentation in the source code, that I found, that shows what the parameters do on the different platforms. I think we'll just run with the defaults for now.
m
Sorry for the delay... Made some tests this morning and it looks like NSURLSession doesn't allow to separate connect/read timeout.
connectTimeout overrides
readTimeout
always for iOS. The PR above fixes that
👌 1
I've asked around in case I'm missing something but looks like that's just not possible on iOS