bug(reducers): updates to arrays inside documents don't work as expected
See original GitHub issueDo you want to request a feature or report a bug?
bug
What is the current behavior?
If you store an array inside a firestore document (e.g. { content: ['an', 'array'] }
) and update that document such that the array is shorter ({ content: ['single'] }
), the update action that fires merges the arrays and doesn’t delete the extra elements ({ content: ['single', 'array'] }
).
Note that { content: ['single'] }
is what is in the firestore database at this stage.
What is the expected behavior? For the array to be pruned
Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups? Definitely exists in 0.5.8, unclear if it worked previously
Steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar. See pull request and the test attached.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:14 (9 by maintainers)
Top GitHub Comments
I have a similar behaviour with objects in a document (instead of an array) when removing a property.
Example :
Will correctly update
data
state in redux but not theordered
one.Edit : Your PR also fixes this issue
Yeesss!! working! thank you!