Bug: doc(...).snapshotChanges does not return DocumentChangeAction
Version info
Angular: 6.0.3
Firebase: 5.1.0
AngularFire: 5.0.0-rc.11
Other: Windows 10, browser (chrome)
How to reproduce these conditions
Subscribe to any DOCUMENT with "snapshotChanges". Eg:
this.afs.collection('myCollection').doc('myDocId')
.snapshotChanges()
.pipe(tap(res => console.log(res))
.subscribe()
Debug output

Expected behavior
According to documentation snapshotChanges 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.
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
@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.
How can I know which change occurred (added, modified, removed) if the type field is always equal to "value"?
Thanks.
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!
The problem persists to the present date. I just met it.
@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.
Still having this issue to this day
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?
closing in favor of #2108