-
Notifications
You must be signed in to change notification settings - Fork 466
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
Unpatch fails for given scenario #60
Comments
+1 I am getting these errors as well. Spent the last 3 hours trying to debug my application. I have several nested documents that may move and have updating values. |
@krickovicd have you attempted to fix the issue in the code? I am exhausted from changing my code thinking it was my fault that the error was happening. I am not sure if I am up to the task of learning this code and fixing the issue. I am fairly new to JS and was planning on using this library to create an audit log and undo for my Mongo objects storing a history of user edits... @benjamine can you respond to this issue? Just curious if this is something to expect a fix on or I should look for another library or a work around. Thanks for the hard work in the library already. Much appreciated. |
Hi, thanks a lot for the failing example, that helped me to create a new failing test case and fixing it. fixed and published as jsondiffpatch@0.1.24 |
Thanks @benjamine though I am still getting this error. I will supply a test scenario after I do a bit more testing and clean up the data I am using for the test case. @krickovicd did this patch work for you? |
This has arrays within arrays which you may not be handling. I tested against the latest code. Here is my left:
Here is my right:
Here is the diff that is created and when trying to unpatch I get the error:
Thanks for taking the time to help debug. |
Hi, thanks for the fix. It's a nice library and easy to use. |
@enkodellc as an alternative to unpatch you can calculate delta for both ways (left to right and right to lef) and use patch with corresponding delta. Since this issue is marked as closed maybe you should create new one with your example? |
Consider the following example:
In this example patch works fine but unpatch fails with the following message: Uncaught TypeError: Cannot read property 'variation' of undefined
The text was updated successfully, but these errors were encountered: