This package allows OkHttp and Retrofit users to use Cronet as their transport layer, benefiting from features like QUIC/HTTP3 support or connection migration.
Apache License 2.0
452
stars
34
forks
source link
Cronet request lifecycle not triggerred as expected when using apollographql/apollo-kotlin` #37
if batching is not enabled - all the requests are considered cancelled (although from the UI point of view - everything seems to be functioning just fine (app is responsive, renders fetched data etc)
Build the app, interact with it, observe it's working fine, and logs contain GQL calls as well as cronet request finished: 0 lines from the cronet http engine (indicating requests are finishing just fine)
Adjust Apollo.kt file in the cloned project:
a. change the logging level of HttpLoggingInterceptor to BASIC
b. disable httpBatching
Observe the app behavior and logs in both 3a and 3b cases:
in 3a - cronet request finished messages are absent and the app hangs after a few interactions
in 3b - all requests are marked as cancalled (as indicated by cronet request finished: 2 log messages
I've created https://github.com/google/cronet-transport-for-okhttp/issues/36 before, but I do not know if those are related (that earlier issue regards sending requests, this one occurs when receiving responses, they could hare a root cause but idk at the moment)
I've adapted https://github.com/apollographql/apollo-kotlin-tutorial to use https://github.com/google/cronet-transport-for-okhttp (https://github.com/duzinkie/apollo-kotlin-tutorial/tree/duzinkie/cronet-lifecycle-repro) and have observed the app is not functioning correctly when Cronet is used as an http engine.
Let me elaborate: The app built from https://github.com/duzinkie/apollo-kotlin-tutorial/tree/duzinkie/cronet-lifecycle-repro is working fine, until one tries to adjust the logging level of HttpLoggingInterceptor (https://github.com/duzinkie/apollo-kotlin-tutorial/commit/9b3e58ab1dbdb9e2a3151a43e3cdb44531e5b079#diff-518bd35be782210b23f518eaf618c538f99e9f33a81f6b518ccb053b4315eff1R94) - when that happens 2 distinct failure modes occur, depending on whether http batching is enabled.
Steps to reproduce the behavior
cronet request finished: 0
lines from the cronet http engine (indicating requests are finishing just fine)HttpLoggingInterceptor
toBASIC
b. disablehttpBatching
cronet request finished
messages are absent and the app hangs after a few interactionscronet request finished: 2
log messagesSide-notes: