{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/binding/issues/226","labels_url":"https://api.github.com/repos/aurelia/binding/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/binding/issues/226/comments","events_url":"https://api.github.com/repos/aurelia/binding/issues/226/events","html_url":"https://github.com/aurelia/binding/pull/226","id":116718346,"number":226,"title":"Deleting last array element generates incorrect change record.","user":{"login":"kevmeister68","id":9400554,"avatar_url":"https://avatars.githubusercontent.com/u/9400554?v=3","gravatar_id":"","url":"https://api.github.com/users/kevmeister68","html_url":"https://github.com/kevmeister68","followers_url":"https://api.github.com/users/kevmeister68/followers","following_url":"https://api.github.com/users/kevmeister68/following{/other_user}","gists_url":"https://api.github.com/users/kevmeister68/gists{/gist_id}","starred_url":"https://api.github.com/users/kevmeister68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevmeister68/subscriptions","organizations_url":"https://api.github.com/users/kevmeister68/orgs","repos_url":"https://api.github.com/users/kevmeister68/repos","events_url":"https://api.github.com/users/kevmeister68/events{/privacy}","received_events_url":"https://api.github.com/users/kevmeister68/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-13T07:37:24Z","updated_at":"2015-11-13T21:57:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aurelia/binding/pulls/226","html_url":"https://github.com/aurelia/binding/pull/226","diff_url":"https://github.com/aurelia/binding/pull/226.diff","patch_url":"https://github.com/aurelia/binding/pull/226.patch"},"body":"Hello Guys, this is my first Pull Request so I hope you'll be lenient on me :-)\r\n\r\nI found a bug whereby deleting the last item of an array results in a repeat.for view actually removing the second-last item not the last item. \r\n\r\nKevin "},"comment":{"url":"https://api.github.com/repos/aurelia/binding/issues/comments/156570732","html_url":"https://github.com/aurelia/binding/pull/226#issuecomment-156570732","issue_url":"https://api.github.com/repos/aurelia/binding/issues/226","id":156570732,"user":{"login":"kevmeister68","id":9400554,"avatar_url":"https://avatars.githubusercontent.com/u/9400554?v=3","gravatar_id":"","url":"https://api.github.com/users/kevmeister68","html_url":"https://github.com/kevmeister68","followers_url":"https://api.github.com/users/kevmeister68/followers","following_url":"https://api.github.com/users/kevmeister68/following{/other_user}","gists_url":"https://api.github.com/users/kevmeister68/gists{/gist_id}","starred_url":"https://api.github.com/users/kevmeister68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevmeister68/subscriptions","organizations_url":"https://api.github.com/users/kevmeister68/orgs","repos_url":"https://api.github.com/users/kevmeister68/repos","events_url":"https://api.github.com/users/kevmeister68/events{/privacy}","received_events_url":"https://api.github.com/users/kevmeister68/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T21:57:27Z","updated_at":"2015-11-13T21:57:27Z","body":"I would add a unit test except I have no idea where they go, or how they work in terms of being testable against a visual outcome, unless the DOM is being explicitly checked afterwards. This was tested on our development codebase and found to fix the \"deleting last item issue\".\r\n\r\nIf there are problems with negative splices, it's not the problem I intended to fix. I think generally, however, it does not make a lot of sense to use a *modified* array as the basis for limiting your parameters in terms of constructing a change record, hence the patch.\r\n\r\nPersonally I think the changeRecord \"handler\" should be making the decisions on how to handle the splice outcome more so than this piece of code, otherwise it is still at the mercy of receiving a bogus changeRecord, if it happened to be injected from elsewhere."}}