{"action":"created","issue":{"url":"https://api.github.com/repos/omniscientjs/omniscient/issues/89","labels_url":"https://api.github.com/repos/omniscientjs/omniscient/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/omniscientjs/omniscient/issues/89/comments","events_url":"https://api.github.com/repos/omniscientjs/omniscient/issues/89/events","html_url":"https://github.com/omniscientjs/omniscient/issues/89","id":60052975,"number":89,"title":"Reordering items in list cursor will confuse updates on captured items.","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-06T03:09:53Z","updated_at":"2015-03-06T09:14:30Z","closed_at":null,"body":"I believe following scenario will cause an issues that we have being observing in our application code:\r\n\r\nLet's say this is more or less our root cursor model `{items: [a, b, c]}`:\r\n\r\n1. Root component creates cursor for a `c` item.\r\n2. Root component passes cursor for a `c` item down to a subcomponent.\r\n3. Event causes order of `items` to be reversed (without causing component that `c` was passed to to be re-triggered).\r\n4. Event in the subcomponent with captured `c` cursor makes an update on `c`.\r\n\r\nOutcome of this steps is that `a` will be replaced with `c` causing us to have end up with `{items: [c, b, c]}`."},"comment":{"url":"https://api.github.com/repos/omniscientjs/omniscient/issues/comments/77528393","html_url":"https://github.com/omniscientjs/omniscient/issues/89#issuecomment-77528393","issue_url":"https://api.github.com/repos/omniscientjs/omniscient/issues/89","id":77528393,"user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T09:14:30Z","updated_at":"2015-03-06T09:14:30Z","body":"> I think this is what was happening:\r\n> \r\n> If the key was just key={item.get('id'), React doesn't know about the ordering of the DOM element, and has accidentally marked the component to not be re-rendered. See: http://facebook.github.io/react/docs/reconciliation.html#keys\r\n> \r\n> This is noticeable that if you turn on debug: component.debug();, there is no shouldComponentUpdate information indicating that the components were reversed after pressing x several times.\r\n\r\nI don't agree. As pointed out the reason react decided to not re-render is because `shouldComponentUpdate` for the `<Item key=x>` was `false` which is because the way cursors are compared (see my earlier comments with links to actual lines). If `isEqualCursor` took `__keyPath` changes into account `shouldComponentUpdate` would have returned `true` and there for re-render would have being triggered.\r\n\r\nAlso note that this is not an issue with plain react as there  `this.props` is updated regardless if re-render is triggered or not. There for `this.props.cursor` would point to right thing. "}}