prescottprue / redux-firestore

Redux bindings for Firestore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

id is removed in 'ordered' when an item is added.

quintenb opened this issue · comments

When I add an item to the firestore db using the add command:

firestore.add({ collection: "bookmarks" }, bookmark)

You see the item is added correctly at first but with the 'createdAt' value still empty.

I use:

createdAt: firestore.FieldValue.serverTimestamp()

bug_01

But when the DOCUMENT_MODIFIED is dispatched and the createdAt is updated in the state, the Id of the document gets removed.

bug_02

Thanks for reporting! Seems like that was a recent change to remove merging. I also added a test case to make sure that doesn't happen in the future.

Planning to release in v0.11.0

commented

I found a workaround, which is to always include id in the args when adding/updating a doc.

But this is not ideal. Hopefully 0.11.0 update will land soon!

Glad to hear you found a workaround. The v0.11.0 release contains the fix. Please reach out if things don't work as expected, and thanks again for posting