Closed codingmatty closed 7 years ago
@codingmatty fixed with this commit I changed the getters so we can use the npm-module deep-equal instead of the custom comparison. This makes sure we have a well-tested deepEqual-function.
I pushed version 3.0.4 to npm. Try it out.
Awesome! Thanks. I was curious why you were using a custom deepEqual function 😜 ¯_(ツ)_/¯
Case
This is a Bug.
Issue
I was trying to update an array and save the document, but it was not saving.
The culprit is within the
isDeepEqual
function: https://github.com/pubkey/rxdb/blob/master/src/RxDocument.js#L324 TheisDeepEqual
function only works if the arrays are the same length, or the original array is longer then the new array. A simple way to fix this would be to add a check for the array lengths before comparing the items in the array.Info
Code
This repl.it will demonstrate the root of the problem: https://repl.it/GRHE/0
Here is a snippet of what I was trying to do