adriancarriger / angularfire2-offline

🔌 A simple wrapper for AngularFire2 to read and write to Firebase while offline, even after a complete refresh.
https://angularfire2-offline.firebaseapp.com/
MIT License
207 stars 48 forks source link

Query logic seems bugged #32

Closed larssn closed 7 years ago

larssn commented 7 years ago

So we've been switching out FirebaseListObservable with the Afo variant.

This has broken the following pretty simply method below. Before the method DID NOT return sessions that were "completed", but now it does.

Is there something I'm misunderstanding? Could it be getting a cached value? :-)

getCompleted() {
        return this.afoDb.list(`/sessions`, {
            query: {
                orderByChild: 'completed',
                equalTo: true,
                limitToLast: 8
            }
        });
    }

Switching back to FirebaseListObservable makes the query work as expected again.

adriancarriger commented 7 years ago

Hi @larssn, yes, it definitely sounds like an issue with the cached value, and this may be a duplicate of issue #9.

If the value is loaded directly from Firebase (skipping the local cache) the query will work, otherwise it will fail. I've made some progress with this on the query-support-3 branch and hope to finish it soon.

Please let me know if this sounds different from issue #9. Thanks!

larssn commented 7 years ago

Its probably related, I'll close this as one topic should be enough.

Sorry for not noticing the existing issue!