redux-firestore
redux-firestore copied to clipboard
Firestore not updating locally after document update
I have a react/redux/firestore app. I have an internal array that is built from a firestore collection. When a document in that collection is updated I need to rebuild the array.
I update the collection using the following: db.collection('skills').doc(skillName).update({included: included}); I set up a listener to catch updates to the collection, which is working fine. The data returned to the listener shows the updated document. However, the firestore data in the state is NOT updated. When I look at state.firestore.ordered.skills, it has the original data.
My understanding was that an update updated the local firestore as well as sending the data to the server. Is this not correct? Am I doing something wrong? How can I tell when the local data has been updated?
I'm occasionally having the same issue, not sure when it happens or why, but it seems to be an inconsistency.
Perhaps it has to do with the order of loading/unloading components that use different useFirestoreConnect's ?