{"action":"created","issue":{"url":"https://api.github.com/repos/benjamine/jsondiffpatch/issues/126","labels_url":"https://api.github.com/repos/benjamine/jsondiffpatch/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/benjamine/jsondiffpatch/issues/126/comments","events_url":"https://api.github.com/repos/benjamine/jsondiffpatch/issues/126/events","html_url":"https://github.com/benjamine/jsondiffpatch/issues/126","id":127343349,"number":126,"title":"Need clarity on whole array diffing/patching","user":{"login":"brandonros","id":8949910,"avatar_url":"https://avatars.githubusercontent.com/u/8949910?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonros","html_url":"https://github.com/brandonros","followers_url":"https://api.github.com/users/brandonros/followers","following_url":"https://api.github.com/users/brandonros/following{/other_user}","gists_url":"https://api.github.com/users/brandonros/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonros/subscriptions","organizations_url":"https://api.github.com/users/brandonros/orgs","repos_url":"https://api.github.com/users/brandonros/repos","events_url":"https://api.github.com/users/brandonros/events{/privacy}","received_events_url":"https://api.github.com/users/brandonros/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-19T01:28:24Z","updated_at":"2016-01-20T22:15:51Z","closed_at":null,"body":"I am using jsondiffpatch in a web service at the moment, and users are complaining about duplicates in their arrays.\r\n\r\nThe only point of patch creation I am doing is currently this: `var delta = jsondiffpatch.diff(old_elements, new_elements);`\r\n\r\nI read the documentation about LCS, then the fallback to position. Do I need to do anything special? What information can I provide? I'm sure it isn't a bug and something on my end."},"comment":{"url":"https://api.github.com/repos/benjamine/jsondiffpatch/issues/comments/173379345","html_url":"https://github.com/benjamine/jsondiffpatch/issues/126#issuecomment-173379345","issue_url":"https://api.github.com/repos/benjamine/jsondiffpatch/issues/126","id":173379345,"user":{"login":"brandonros","id":8949910,"avatar_url":"https://avatars.githubusercontent.com/u/8949910?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonros","html_url":"https://github.com/brandonros","followers_url":"https://api.github.com/users/brandonros/followers","following_url":"https://api.github.com/users/brandonros/following{/other_user}","gists_url":"https://api.github.com/users/brandonros/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonros/subscriptions","organizations_url":"https://api.github.com/users/brandonros/orgs","repos_url":"https://api.github.com/users/brandonros/repos","events_url":"https://api.github.com/users/brandonros/events{/privacy}","received_events_url":"https://api.github.com/users/brandonros/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T22:15:51Z","updated_at":"2016-01-20T22:15:51Z","body":"@benjamine \r\n\r\n```\r\nvar a = [{\r\n\tid: '1',\r\n\tmoo: [{\r\n\t\t'b': 123\r\n\t}]\r\n}];\r\n\r\nvar b = [{\r\n\tid: '1',\r\n\tmoo: [{\r\n\t\t'b': 123\r\n\t}]\r\n}];\r\n\r\nvar diffpatcher = jsondiffpatch.create({\r\n\tobjectHash: function (obj) {\r\n\t\treturn obj['id'].toString();\r\n\t}\r\n});\r\n\r\nconsole.log(diffpatcher.diff(a, b));\r\n```\r\n\r\nWatch the error thrown. It traverses into a.moo and b.moo."}}