awslabs / aws-mobile-appsync-sdk-android

Android SDK for AWS AppSync.
https://docs.amplify.aws/sdk/api/graphql/q/platform/android/
Apache License 2.0
105 stars 58 forks source link

ConcurrentModificationException @ ApolloCacheInterceptor #357

Open juandiana opened 3 years ago

juandiana commented 3 years ago

AppSync SDK Version: 3.1.4 (latest as of Jul 7)

It's pretty straightforward. This should be all you need to fix but please let me know if you need anything.

Stacktrace

Fatal Exception: java.util.ConcurrentModificationException
       at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:757)
       at java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:785)
       at com.apollographql.apollo.internal.interceptor.ApolloCacheInterceptor$2.apply(ApolloCacheInterceptor.java:137)
       at com.apollographql.apollo.internal.interceptor.ApolloCacheInterceptor$2.apply(ApolloCacheInterceptor.java:134)
       at com.apollographql.apollo.api.internal.Present.map(Present.java:70)
       at com.apollographql.apollo.internal.interceptor.ApolloCacheInterceptor.cacheResponse(ApolloCacheInterceptor.java:133)
       at com.apollographql.apollo.internal.interceptor.ApolloCacheInterceptor.access$200(ApolloCacheInterceptor.java:43)
       at com.apollographql.apollo.internal.interceptor.ApolloCacheInterceptor$1$1.onResponse(ApolloCacheInterceptor.java:81)
       at com.apollographql.apollo.internal.interceptor.ApolloParseInterceptor$1.onResponse(ApolloParseInterceptor.java:71)
       at com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor$1$1.onResponse(ApolloServerInterceptor.java:100)
       at okhttp3.RealCall$AsyncCall.run(RealCall.kt:140)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:923)