-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Possible bug in “queryOrdered(byChild:).queryEqual(toValue:).getData" function #8286
Comments
Apologies for the delay on this. It looks like you're using v8.1.1 of the SDK. Could you try >= v8.5.0, which contains an important fix for the FWIW, I tried to reproduce the issue you've described in this draft PR: https://github.com/firebase/firebase-ios-sdk/pull/8618/files and was not able to get the observer to fire a second time as you described. |
@IanWyszynski I still get the same output in version 8.6.1 can you please download my file and run it? it's just 7 lines. |
@IanWyszynski @schmidt-sebastian @jeremydurham so this issue is still not fixed after 10 months? |
Apologies for the delay on this. I'll have a look at this again today. |
@IanWyszynski thank you, hope you can fix it. |
I investigated this issue for a few hours yesterday. The problem here is with the way that It's easy enough to remove that call and make your code sample work, but We'll need to either figure out how to merge get responses into the local cache, or re-implement get to wrap a once-listener, but only fallback to it's results if the server is unresponsive. I'm going to take a stab at implementing the later, but the fix we ultimately decide on will require some discussion, so it might take a few days. I'll update this issue with any developments. |
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur?
I’m observing how many children a person called "james" has using child("james").child("children").observe(.value) function, in my case he has 2 children called "child1" and "child2" so it prints children count = 2. Then I check if "james" has a child called "child2" using child("james").child("children").queryOrdered(byChild: "name").queryEqual(toValue: "child2").getData function, in my case he has a child called "child2" so it prints found. Then unexpectedly the first observe function that observes and prints children count triggers again and prints children count = 1. I think the first observe function should not trigger and the children’s count should remain at 2. If I replace getData function with observe function to search for a child named "child2" it finds it and prints found and the first observe function that observes and prints children count does not trigger and the children count remains 2.
If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.
https://github.com/fawzialrifai/People
Relevant Code:
The text was updated successfully, but these errors were encountered: