Realm-java: findAllAsync() sometimes fails to return any results when using it in sync mode

Created on 22 Dec 2016  Â·  10Comments  Â·  Source: realm/realm-java

Sometimes findAllAsync() does not call the change listener.

I created a sample project that demonstrates the issue. Actually, I just copied the _RealmTasks_ example, removed the Facebook SDK and then replaced findAll() with findAllAsync(). You can find it here: https://github.com/joluet/RealmTasksDemo

This project lets you reproduce the issue consistently. To reproduce it I follow these steps:

  1. Make sure Realm Object Server is running and connected
  2. Register a new user in the app
  3. Navigate back to get to the TaskListActivity
  4. Observe that there is no task list
  5. Rotating the phone or restarting the app will bring back the list called _My Task_

Also, deleting, adding, or editing list items can make task lists disappear.

T-Bug

Most helpful comment

Thank you very much for this. We will look into it.

All 10 comments

Thank you very much for this. We will look into it.

Thanks for you report. I reproduced this problem and I am checking whether there is a mistake of RealmTasks first.

@dalinaum @cmelchior any progress on this one?

@dalinaum What is the status on this?

We need to verify that this is still a problem after #3834 has been merged.

@joluet There is a work-around. If you move some code from onStart and onStop to onResume and onPause, it would works. I doubt that there are some timing issues.

We will look into this issue with a new implementation soon.

I don't think that should affect anything,.. 😞

@dalinaum can you please help to verify if this is fixed by #3834? It has been merged to the master and the snapshot should be available.

This should have been fixed by either Realm 3.0 or Realm 3.1....

This should have been fixed by Realm Java 3.1 with notifications on commit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

David-Kuper picture David-Kuper  Â·  3Comments

yuwu picture yuwu  Â·  3Comments

aschrijver picture aschrijver  Â·  3Comments

jjorian picture jjorian  Â·  3Comments

wezley98 picture wezley98  Â·  3Comments