-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with addChangeListener on async query, without objects created. #4352
Comments
addChangeListener
without objects created.
Are you sure you don't just have to keep |
I use that workflow with more complex queries, to create objects on demand when However, since Then, I simplified the code down to the use-case above, and it still isn't called. |
Please try if you have it as field reference; if it is still not called then that's definitely something to look at. |
Even with I forgot to mention that I'm using Kotlin, but I don't see anything wrong with the decompiled code (and I don't have any other issues). |
@jpmcosta if the db doesn't contain any |
That's not good for my use case, as I'm waiting for the query to end to check if there is a valid instance of
|
hmm, the doc doesn't match the behavior even before 3.0.0 ... |
@jpmcosta The workaround for you now is either you can use the sync version |
Either one is probably fine in my use case. Thanks! 👍 |
Fix #4352 The findFirstAsync()'s behavior doesn't match the javadoc from the first day the API was introduced. It kept running the query until it could find a row match the query condition. This behavior create difficulties if user want to check if there is no object in the db. Also it was not consistent with the behavior of findFirst() which will return an invalid row in the same condition.
Fix is merged and will be available in 3.0.1+ |
Goal
In Realm
3.0.0
, the following code, documented inisLoaded()
method, doesn't seem to work, if there aren't anyPerson
objects created in the database.Expected Results
onChange()
should be called withperson.isLoaded() == true
andperson.isValid() == false
.Actual Results
onChange()
is never called.Version of Realm and tooling
Realm version: 3.0.0
The text was updated successfully, but these errors were encountered: