Eduard BoloÈ™
10/13/2022, 11:02 AMDefaultApolloStore.readFragment() (full stacktrace in thread). We call this function using a Dispatchers.Main.immediate scope. Just to validate my understanding, Apollo doesn't do anything about running this method in the background, thus the ANR, and we should use some other dispatcher instead. Does that sound about right?Eduard BoloÈ™
10/13/2022, 11:02 AMio.sentry.android.core.ApplicationNotResponding: Application Not Responding for at least 5000 ms.
at java.lang.Object.wait(Object.java)
at java.lang.Thread.parkFor$(Thread.java:2137)
at sun.misc.Unsafe.park(Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:868)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:993)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1307)
at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:729)
at com.apollographql.apollo3.cache.normalized.internal.Lock.read(Lock.kt:11)
at com.apollographql.apollo3.cache.normalized.internal.DefaultApolloStore.readFragment
at com.apollographql.apollo3.cache.normalized.ApolloStore$DefaultImpls.readFragment$default(ApolloStore.kt:58)mbonnin
10/13/2022, 11:16 AMsuspend , that's certainly something we'll want to change.mbonnin
10/13/2022, 11:18 AMsuspend but then we need a way to specify the default dispatchermbonnin
10/13/2022, 11:22 AMEduard BoloÈ™
10/13/2022, 12:49 PMApolloClient already has a dispatcher defined, wouldn't it make sense to have the same one used by the store? Or do you think that there is a case for having a different one?mbonnin
10/13/2022, 12:51 PMApolloStore can be created without an ApolloClient . Not really sure what the use case for this is but it's possible so we'd have to "bind/propagate" the Dispatcher somehowmbonnin
10/13/2022, 12:52 PMCustomScalarAdapters actually, ApolloStore doesn't know anything of the CustomScalarAdapters in your ApolloClientmbonnin
10/13/2022, 12:53 PMCustomScalarAdapters all aroundEduard BoloÈ™
10/13/2022, 12:59 PMmbonnin
10/13/2022, 1:03 PM