You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell the copy calculation mechanism is fundamentally broken; it finds nodes in the document that stay the same (position/value) after applying the patch, and makes a few assumptions about whether or not they're valid to use. The problem is, copy ops source from the current document as the patch is being applied, meaning that assumption can always be busted.
I'm currently researching a cleaner solution where the diff algorithm actually keeps track of the available document state (you can track progress on my fork in the issue-104 branch). This will likely be quite expensive memory-wise, but will be optional with DiffFlags.OMIT_COPY_OPERATION so it's OK as long as it's documented.
Hi all,
first thank you for that awesome library :)
We've encountered a bug where a diff created via
^ In other words the generated diff is invalid. An exception is thrown when applying the diff...
Expected Behavior
Given source and target json.
Then target equals JsonPatch.apply(JsonDiff.asJson(source, target), source)
Actual Behavior
thrown exception: [COPY Operation] Missing field xxx
If you create the diff via
it works but the diff might get big...
Specifications
Library Version: (0.4.5-SNAPSHOT until current) 0.4.9
Language (e.g. Java 1.8, Scala, etc): JAVA11
Steps to Reproduce the Problem
This is tricky - I wasn't able to reduce the problem further:
The text was updated successfully, but these errors were encountered: