angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.66k stars 2.19k forks source link

snapshotChanges not returning correct results after open valueChanges subscription #1963

Closed tmk1991 closed 3 years ago

tmk1991 commented 5 years ago

Version info

Angular: 5.2.10

Firebase: 5.5.9

AngularFire: 5.1.0

Other (e.g. Ionic/Cordova, Node, browser, operating system): Ionic 3.9.2

How to reproduce these conditions

Steps to set up and reproduce First open a subscription to a collection or document in the first component / page.

this.db.collection('apples').valueChanges().subscribe()

In another component, leaving the first subscription open, try to make a call to the same collection with snapshotChanges() and a queryFn.

this.db.collection('apples',queryFn).snapshotChanges().subscribe()

Replacing the second call with .get() works as expected.

Sample data and security rules

rules are set up to read all if true;

Expected behavior

Being able to leave a subscription open to a document or collection with valueChanges() and make subsequent snapshotChanges() calls to the same collection endpoint.

Actual behavior

The next document of the first opened subscription returns in the subsequent snapshotChanges() call.

jek-bao-choo commented 5 years ago

https://github.com/angular/angularfire2/issues/2012

jamesdaniels commented 3 years ago

Not clear what this issue is. Cache maybe? Closing.

jek-bao-choo commented 3 years ago

https://github.com/angular/angularfire/issues/2012