-
Notifications
You must be signed in to change notification settings - Fork 4k
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
🐛 [firebase_database] get() return incorrect results #10145
Comments
Thanks for the detailed report @bonnybun |
Did you set the rules in your db @darshankawar ?
|
Yes, I have the rules properly set. I figured that the database instance reference isn't correct as mentioned in your code sample. Instead of 10145.movAccording to my findings, tapping |
Your problem is that "organizations" should be an array, not an object. It's like a list of companies. You can also import this json in your root database Get() and Once() must always return the same value : but after a subscription on a parent, the result of Get() becomes : |
I see, thanks. I updated the db to have the root node to be an array and then ran the code sample again which gives me same results as you mentioned above:
|
Hi @darshankawar Is there anything else we can do on our end regarding this issue? |
I think Guillaume should be aware of your comment in that PR and since you have tagged him in it, he'll probably let you know if there's anything else required from your end. |
Sounds good, we'll wait :) |
Hello, I don't know why OP hasn't back but I am having the same exact issue. In my case I'm attaching a listener using
then a subsequent read from a child path such as: Will return the wrong data, at the parent path "a/path/to/data" If I run the following:
then a subsequent read from a child path such as: will return the correct data at the parent path "a/path/to/data/child/node" This is the behaviour running on an iPhone 15 Pro simulator with:
|
Thank you for the report, I have opened an issue on the Firebase iOS SDK: firebase/firebase-ios-sdk#12225 |
The same problem happens to me when using Removing keepSynced the problem does not occur. |
Bug report
This report relate to issue #9067
If I subscribe to a database reference, call get() function on a child reference will return wrong value in iOS.
On Android it works as expected.
A workaround exist using once() but it hasn't exactly the same behavior as get().
Steps to reproduce
Expected behavior
I want to get the value of the key 'data'.
The expected value is
["a","b","c","d","e","f","g","h"]
Calling get() or once() should return the same value.
But if a suscription is made on the parent, the get() function will return the suscription's value.
And once() return the correct value
This problem doesn't exist when I run on an android device
Sample project
sample_project
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: