angular / angularfire

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

Bad AngularFirestore snapshot/value results (JS SDK 8.0.2) #2660

Closed rulamon closed 3 years ago

rulamon commented 3 years ago

Version info

Angular: 11.0.0

Firebase: 8.0.2

AngularFire: 6.1.0-rc.3

How to reproduce these conditions

https://stackblitz.com/edit/angular-ivy-izcnu6?file=src/app/app.component.ts

When clicking the button, each doc from the collection gets updated with a new 'number' value that's one higher than the previous. Check the console for the data coming in from snapshotChanges.

Expected behavior

After updating the data in the docs of a collection, snapshotChanges should fire with the new data.

Actual behavior

SnapshotChanges fires with the data from before the update, even though the update to cloud firestore succeeded, as proved with the data returned by a normal get.

jamesdaniels commented 3 years ago

This appears to be a regression with Firebase 8.0.2, roll back to 8.0.1 to get the correct behavior. See https://github.com/firebase/firebase-js-sdk/issues/4071

jamesdaniels commented 3 years ago

Closing and pinning since it's a JS SDK issue that's being worked on. Work-around noted above.