You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: doc(...).snapshotChanges does not return DocumentChangeAction #1762
According to documentationsnapshotChanges should return Observable<DocumentChangeAction<T>>.
Actual behavior
What it does return is Observable<Action<DocumentSnapshot<T>>>. type field is always "value" even if I delete record and payload does not seem to contain actual data (I was not able to find it).
Remarks
snapshotChanges works well on collections returning Observable<DocumentChangeAction<T>[]>. Problem occurs only when using it on document.
@Bielik20@Noext We are changing doc.snapshotChanges() to return a Observable<DocumentSnapshot<T>> in the next release. The type is useless on it because it is always a value update regardless of the type of change.
Hi @davideast thanks for all the hard work on this great project, love the way it auto-syncs data. Favor: could one of the contributors update the docs on the doc.snapshotChanges() method? I'm using @angular/fire 5.0.0 and this change is in there, but I have next to no idea how to use this method now.
@davideast what release were you referencing? I couldn't find anything finished or a pull request and the unusable type causes quite dirty code down the line.
Having same issue as author, the type on Action type is always returning value no matter what. Maybe we must use snapshotChanges() on a collection-document chain instead?
I have same issue, is imposible to know what type of changes was performed over one specific document using the snapshotChanges, someone know some workaround to resolve this issue?
Activity
Noext commentedon Jul 26, 2018
same issue on ubuntu
this.db.collection('polls').doc('id').snapshotChanges().subscribe(poll => {})poll.payload is not a DocumentChange, so you can't call .doc property to retrieve le document
davideast commentedon Aug 17, 2018
@Bielik20 @Noext We are changing
doc.snapshotChanges()to return aObservable<DocumentSnapshot<T>>in the next release. Thetypeis useless on it because it is always a value update regardless of the type of change.CheckMater commentedon Sep 2, 2018
How can I know which change occurred (added, modified, removed) if the type field is always equal to "value"?
Thanks.
AnthonyGilliam commentedon Sep 22, 2018
Hi @davideast thanks for all the hard work on this great project, love the way it auto-syncs data. Favor: could one of the contributors update the docs on the doc.snapshotChanges() method? I'm using @angular/fire 5.0.0 and this change is in there, but I have next to no idea how to use this method now.
THANKS!
rubenCortes commentedon May 10, 2019
The problem persists to the present date. I just met it.
Malspherus commentedon May 17, 2019
@davideast what release were you referencing? I couldn't find anything finished or a pull request and the unusable type causes quite dirty code down the line.
mcarriere commentedon Jun 1, 2020
Still having this issue to this day
KingDarBoja commentedon Jun 4, 2020
Having same issue as author, the
typeonActiontype is always returning value no matter what. Maybe we must usesnapshotChanges()on a collection-document chain instead?sur97c commentedon Jun 9, 2020
I have same issue, is imposible to know what type of changes was performed over one specific document using the snapshotChanges, someone know some workaround to resolve this issue?
jamesdaniels commentedon Nov 18, 2020
closing in favor of #2108