Angular: 2.4.3
Firebase: 3.6.0
AngularFire: 2.0.0-beta.7
Steps to set up and reproduce
Plnkr example of the issue
FirebaseListObservable doesn't always return all the queried items. When we use query options like startAt & orderByChild.
Add the code below to your project and the data to Firebase
Start changing the order properties from positive to negative and back again from Firebase console
Here's a reproducable example that you can test:
// ANGULARFIRE
this.af.database.list('order_testing', {
query: {
orderByChild: 'order',
startAt: 0
}
}).subscribe(x => console.log('ANGULARFIRE:', x.length));
// FIREBASE
this.af.database.list('order_testing').$ref.orderByChild('order').startAt(0).on('value', (x) => {
console.log('FIREBASE:', Object.keys(x.val()).length)
});
Sample data and security rules
Here's the data located under order_testing in Firebase
{
"obj1" : {
"order" : 1
},
"obj2" : {
"order" : 2
},
"obj3" : {
"order" : 3
},
"obj4" : {
"order" : 4
},
"obj5" : {
"order" : 5
}
}
FIREBASE: 5
ANGULARFIRE: 5
// After changing some ordering to negative and back to positive the number of items will differ
FIREBASE: 5
ANGULARFIRE: 4
The logged values from Angularfire & Firebase should remain the same after changes to order property
The logged values from Angularfire & Firebase are not the same after changing the order property
Thank you for the detailed write-up! Can I also trouble you for a plnkr? We have a template here: http://plnkr.co/edit/8yY4tH?p=preview
This will ensure we're tackling the same problem and make it much easier for me to debug.
Hey! I've made a plnkr available for you. See if it helps: http://plnkr.co/edit/9UzrMSHPowJ1K4zMbiQz?p=preview
@antti-pyykkonen This looks very much like the problem that was addressed in PR #775.
@cartant @antti-pyykkonen I'll be cutting a next release soon. I'll update this thread when it's out.
@cartant I'm trying to find your contact info, but you a hard person to find! Send me an email to [email protected], and let's talk about some AF2 :)
I believe this is now solved?
@antti-pyykkonen Yes it is!
Most helpful comment
@cartant @antti-pyykkonen I'll be cutting a
nextrelease soon. I'll update this thread when it's out.