Closed samedhi closed 4 years ago
Remember that on write Firestore always first returns a {hasPendingWrite: true}
. Default behavior is to not create events for metadata only changes. So the notification you are first receiving is the "local" write change, you received a second notification when it was actually written to the server, but firebases default behavior is to not surface that second notification as it is a metadata only change.
TODO: Default behavior should be to stay within the behavior of firestore. I think all write things should accept a third optional argument that is a map of options. One key in this made would be :include-metadata-changes
. Pretty simple.
TODO: You can see whether a document is persisted or not by looking at its clojure meta and change :has-pending-write
TODO: Make it more clear where the metadata for each object is actually being written in the firestore.cljs ns. Currently it is kind of all over.
#js {:includeMetadataChanges true}
https://firebase.google.com/docs/firestore/query-data/listen
Currently you do not receive metadata updates. I think this is fine for now but might be a feature needed at some point in the future.