Correct index passed to DiffInternal for modification detection in LS… #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed that the diff of arrays was not always correct when items were removed, modified and added.
The modifications where not identified.
example:
Lets assume I want to diff the following
{ "id": "644fe678c3541f5485b760d2", "myArray": [ { "id": "644fe6b2c3541f5485b7639f", "comment": "bogus" }, { "id": "65fa21a122020709ac83b0ca", "comment": "willberemoved" }, { "id": "644febdbc3541f5485b79026", "comment": "foobar" }, { "id": "645001bfc3541f5485b7e189", "comment": "example" }, { "id": "645003fac3541f5485b7f2ab", "comment": "ok" } ] }
with
{ "id": "644fe678c3541f5485b760d2", "myArray": [ { "id": "644fe6b2c3541f5485b7639f", "comment": "bogus" }, { "id": "644febdbc3541f5485b79026", "comment": "foobar" }, { "id": "645001bfc3541f5485b7e189", "comment": "example adapted" }, { "id": "645003fac3541f5485b7f2ab", "comment": "ok" }, { "id": "myid", "comment": "isadded" }, { "id": "myid2", "comment": "isadded2" }
[example, example modified] modification is not found by the diff (delta format).
After some investigation it seems to just pass the wrong index to the DiffInternal in the LCS when checking for modifications in the right side.
After the modification the delta includes the modification as well.