-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(reducers): ordered state not updated with added item in array #116
Comments
There have been a number of issues reported relating to how subcollections are stored. To address these, I have started the v1.0.0 Roadmap doc which includes notes about the current plans for the new state pattern. This new state pattern should make it relatively easy to debug issues like this. |
Just to clarify: Are you adding the document directly to state or calling a method to write to Firestore? Writes directly to state WILL NOT update Firestore or RTDB, it requires calling a method which in turn dispatches an action. Since there are others that have 👍 I am going to assume that you are in fact writing to Firestore and I am just misunderstanding the description. Going to attempt to replicate. |
* feat(reducers): `ordered` and `data` reducer using new v1 state pattern outlined in [the v1.0.0 roadmap](https://github.com/prescottprue/redux-firestore/wiki/v1.0.0-Roadmap) (full query path in ordered, sub-collections separate from doc in data) * feat(core): `firestoreDataSelector ` and`firestoreOrderedSelector` utilities for selecting values from state * fix(reducers): `LISTENER_RESPONSE` action not correctly updating state for sub-collections - #103 * fix(reducers): `ordered` state not updated with added item in array - #116 * fix(reducers): updates to arrays inside documents don't work as expected - #140
i think this is fixed |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
If i add a document to firestore, the state at
state.firestore.ordered['someList]
will not update correctly, all the existing items will still be in the array, with repeated items along with the new item, when i update an item the item still remains in the state, and the updated item will add itself to the array. this leads to repeations
What is the expected behavior?
Expected is to delete the whole array from the state, and then create new item with the existing item.
Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups?
react-redux-firebase: 2.1.6
redux-firestore: 0.5.7
The text was updated successfully, but these errors were encountered: