Uploaded image for project: 'Realm Java SDK'
  1. Realm Java SDK
  2. RJAVA-1263

RealmResults iterator throw ArrayIndexOutOfBoundsException in concurrent case

      How frequently does the bug occur?

      Sometimes

      Description

      I'm using {{toFlow }} to cache in {{ViewModel }} and when I read the cache in multiple scenes, sometimes an exception is thrown.

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      java.lang.ArrayIndexOutOfBoundsException: length=10; index=10
      	at java.util.ArrayList.add(ArrayList.java:468)
      	at io.realm.internal.OsSharedRealm.addIterator(OsSharedRealm.java:515)
      	at io.realm.internal.OsResults$Iterator.<init>(OsResults.java:68)
      	at io.realm.OrderedRealmCollectionImpl$RealmCollectionIterator.<init>(OrderedRealmCollectionImpl.java:531)
      	at io.realm.OrderedRealmCollectionImpl.iterator(OrderedRealmCollectionImpl.java:221)
      	at io.realm.RealmResults.iterator(RealmResults.java:71)
      

      Can you reproduce the bug?

      Sometimes

      Reproduction Steps

      No response

      Version

      10.18.0

      What Atlas App Services are you using?

      Local Database only

      Are you using encryption?

      Yes

      Platform OS and version(s)

      Android

      Build environment

      Android Studio version: 2023.3.1 Patch 1
      Android Build Tools version: 34.0.0
      Gradle version: 8.6

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

              Created:
              Updated: