ANR in sentry when making a network call with retrofit when using suspend functions. Very interesting... I guess serialization with moshi ends up being done on the main thread and that has an issue? Or am I interpreting this wrong?
j
jw
05/13/2024, 6:50 PM
It's creating the adapter, not doing serialization
jw
05/13/2024, 6:52 PM
Consider using Moshi codegen so you don't have to do kotlin-reflect
jw
05/13/2024, 6:52 PM
or using kotlinx.serialization
c
Colton Idle
05/13/2024, 6:53 PM
Interesting. And creating the adapter is creating the ANR? Weird. I wonder what the heck I did to get in this mess.
j
jw
05/13/2024, 6:57 PM
Yes. kotlin-reflect has to parse a protocol buffer that's compressed with a format called 7in8 (or something) and stored in a string inside an annotation on each class. It is quite slow.