Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-1097

ConcurrentModificationException

      How frequently does the bug occur?

      Sometimes

      Description

      copyToRealm(entity, UpdatePolicy.ALL)?.let {
         doSomething(it)
      }
      
      ```it crashed on line copyToRealm(entity, UpdatePolicy.ALL)?.let
      
      ### Stacktrace & log output
      
      ```shell
      java.util.ConcurrentModificationException
                                                                                                          	at java.util.ArrayList$Itr.next(ArrayList.java:860)
                                                                                                          	at io.realm.kotlin.internal.ListOperator$DefaultImpls.insertAll(RealmListInternal.kt:234)
                                                                                                          	at io.realm.kotlin.internal.BaseRealmObjectListOperator.insertAll(RealmListInternal.kt:307)
                                                                                                          	at io.realm.kotlin.internal.RealmObjectHelper.assignTyped$io_realm_kotlin_library(RealmObjectHelper.kt:801)
                                                                                                          	at io.realm.kotlin.internal.RealmObjectHelper.assign$io_realm_kotlin_library(RealmObjectHelper.kt:734)
                                                                                                          	at io.realm.kotlin.internal.RealmUtilsKt.copyToRealm(RealmUtils.kt:220)
                                                                                                          	at io.realm.kotlin.internal.RealmObjectHelper.assignTyped$io_realm_kotlin_library(RealmObjectHelper.kt:2425)
                                                                                                          	at io.realm.kotlin.internal.RealmObjectHelper.assign$io_realm_kotlin_library(RealmObjectHelper.kt:734)
                                                                                                          	at io.realm.kotlin.internal.RealmUtilsKt.copyToRealm(RealmUtils.kt:220)
                                                                                                          	at io.realm.kotlin.internal.RealmUtilsKt.copyToRealm$default(RealmUtils.kt:144)
                                                                                                          	at io.realm.kotlin.internal.InternalMutableRealm$DefaultImpls.copyToRealm(InternalMutableRealm.kt:57)
                                                                                                          	at io.realm.kotlin.internal.SuspendableWriter$WriterRealm.copyToRealm(SuspendableWriter.kt:58)
      

      ```

      Can you reproduce the bug?

      Sometimes

      Reproduction Steps

      No response

      Version

      1.16.0

      What Atlas App Services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      Android 9

      Build environment

      Android Studio version: Intellij 2024.1.2
      Android Build Tools version: SDK 34
      Gradle version: 8.5

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: