RealmList OrderedRealmCollectionChangeListener bug
there is issue with OrderedRealmCollectionChangeListener and RealmList, when i am adding new item/remove item to/from the RealmList on the same thread using executeTransaction it take time until the OrderedRealmCollectionChangeListener (that was added to the same list for another instance of the realm list it is ok) get notification about the change,
from what i checked it is around 10-50 mills, the problem is that the realmList is affected Immediately or after some delay but before the OrderedRealmCollectionChangeListener , so mean while if i am using tools like RecyclerViewAdapter and try to get the list according to the RealmList notification i may access some items that already been deleted, or i can get different items from what the adapter excepted,
realm version in use: 3.0.0
Yes, currently the change notification for collections is not triggered immediately if the transaction happens to the local thread. This is because of we try to compute the change set in a bg thread to avoid block UI. However, i can understand your problem and we are actually discussing about trigger the notification immediately just as what you say. See #4245 .
RealmList notification i may access some items that already been deleted, or i can get different items from what the adapter excepted
The above won't happen -- The data will have been already updated after the local transaction committed. the only thing delayed is the notification.
May I know what is your use case for this problem? Is it about drag & drop for RecyclerView?
@idok595 As #4368 has been merged, I am closing the issue. Don't hesitate to create a new issue if you still have problems.