{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/comments/92642612","pull_request_review_id":13162436,"id":92642612,"diff_hunk":"@@ -145,9 +145,13 @@ module.exports = React.createClass({\n     },\n \n     shouldComponentUpdate: function(nextProps, nextState) {\n+        // Update if\n+        //  - The number of summarised events has changed\n+        //  - or if the summary is currently expanded\n+        //  - or if the summary is about to toggle to become collapsed\n         return (\n             nextProps.events.length !== this.props.events.length ||\n-            nextState.expanded !== this.state.expanded\n+            this.state.expanded || nextState.expanded","path":"src/components/views/elements/MemberEventListSummary.js","position":null,"original_position":11,"commit_id":"55f85befc1c3e512cb63477e08ea884bf8a99778","original_commit_id":"55f85befc1c3e512cb63477e08ea884bf8a99778","user":{"login":"richvdh","id":1389908,"avatar_url":"https://avatars.githubusercontent.com/u/1389908?v=3","gravatar_id":"","url":"https://api.github.com/users/richvdh","html_url":"https://github.com/richvdh","followers_url":"https://api.github.com/users/richvdh/followers","following_url":"https://api.github.com/users/richvdh/following{/other_user}","gists_url":"https://api.github.com/users/richvdh/gists{/gist_id}","starred_url":"https://api.github.com/users/richvdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richvdh/subscriptions","organizations_url":"https://api.github.com/users/richvdh/orgs","repos_url":"https://api.github.com/users/richvdh/repos","events_url":"https://api.github.com/users/richvdh/events{/privacy}","received_events_url":"https://api.github.com/users/richvdh/received_events","type":"User","site_admin":false},"body":"I thought we auto-expanded if there were \"few\" events?\r\n\r\nSo we should treat \"few\" events the same as \"state.expanded\"","created_at":"2016-12-15T16:18:40Z","updated_at":"2016-12-15T16:18:40Z","html_url":"https://github.com/matrix-org/matrix-react-sdk/pull/590#discussion_r92642612","pull_request_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590","_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/comments/92642612"},"html":{"href":"https://github.com/matrix-org/matrix-react-sdk/pull/590#discussion_r92642612"},"pull_request":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590"}}},"pull_request":{"url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590","id":97975703,"html_url":"https://github.com/matrix-org/matrix-react-sdk/pull/590","diff_url":"https://github.com/matrix-org/matrix-react-sdk/pull/590.diff","patch_url":"https://github.com/matrix-org/matrix-react-sdk/pull/590.patch","issue_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/590","number":590,"state":"open","locked":false,"title":"Improve the performance of MemberEventListSummary","user":{"login":"lukebarnard1","id":6750344,"avatar_url":"https://avatars.githubusercontent.com/u/6750344?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebarnard1","html_url":"https://github.com/lukebarnard1","followers_url":"https://api.github.com/users/lukebarnard1/followers","following_url":"https://api.github.com/users/lukebarnard1/following{/other_user}","gists_url":"https://api.github.com/users/lukebarnard1/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebarnard1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebarnard1/subscriptions","organizations_url":"https://api.github.com/users/lukebarnard1/orgs","repos_url":"https://api.github.com/users/lukebarnard1/repos","events_url":"https://api.github.com/users/lukebarnard1/events{/privacy}","received_events_url":"https://api.github.com/users/lukebarnard1/received_events","type":"User","site_admin":false},"body":"- The MessagePanel now uses the same key for the MELS instances rendered so that entirely new instances are not created, they are simply passed new props (namely when new events arrive).\r\n- MELS itself now uses `shouldComponentUpdate` so that it only updates if it is given a different number of events to previous or if it is toggled to expand.\r\n- The render event is now linear in complexity as opposed to O(n^2) as it was previously.","created_at":"2016-12-14T15:36:11Z","updated_at":"2016-12-15T16:18:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c956f241a6827153b9194d4cf16159e15da97028","assignee":{"login":"lukebarnard1","id":6750344,"avatar_url":"https://avatars.githubusercontent.com/u/6750344?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebarnard1","html_url":"https://github.com/lukebarnard1","followers_url":"https://api.github.com/users/lukebarnard1/followers","following_url":"https://api.github.com/users/lukebarnard1/following{/other_user}","gists_url":"https://api.github.com/users/lukebarnard1/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebarnard1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebarnard1/subscriptions","organizations_url":"https://api.github.com/users/lukebarnard1/orgs","repos_url":"https://api.github.com/users/lukebarnard1/repos","events_url":"https://api.github.com/users/lukebarnard1/events{/privacy}","received_events_url":"https://api.github.com/users/lukebarnard1/received_events","type":"User","site_admin":false},"assignees":[{"login":"lukebarnard1","id":6750344,"avatar_url":"https://avatars.githubusercontent.com/u/6750344?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebarnard1","html_url":"https://github.com/lukebarnard1","followers_url":"https://api.github.com/users/lukebarnard1/followers","following_url":"https://api.github.com/users/lukebarnard1/following{/other_user}","gists_url":"https://api.github.com/users/lukebarnard1/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebarnard1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebarnard1/subscriptions","organizations_url":"https://api.github.com/users/lukebarnard1/orgs","repos_url":"https://api.github.com/users/lukebarnard1/repos","events_url":"https://api.github.com/users/lukebarnard1/events{/privacy}","received_events_url":"https://api.github.com/users/lukebarnard1/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590/commits","review_comments_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590/comments","review_comment_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/590/comments","statuses_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/statuses/55f85befc1c3e512cb63477e08ea884bf8a99778","head":{"label":"matrix-org:luke/fix-membereventlistsummary-performance","ref":"luke/fix-membereventlistsummary-performance","sha":"55f85befc1c3e512cb63477e08ea884bf8a99778","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":37144575,"name":"matrix-react-sdk","full_name":"matrix-org/matrix-react-sdk","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-react-sdk","description":"Matrix SDK for React Javascript","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-react-sdk","forks_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/deployments","created_at":"2015-06-09T16:37:07Z","updated_at":"2016-12-10T07:39:08Z","pushed_at":"2016-12-15T16:16:55Z","git_url":"git://github.com/matrix-org/matrix-react-sdk.git","ssh_url":"git@github.com:matrix-org/matrix-react-sdk.git","clone_url":"https://github.com/matrix-org/matrix-react-sdk.git","svn_url":"https://github.com/matrix-org/matrix-react-sdk","homepage":null,"size":4105,"stargazers_count":65,"watchers_count":65,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":9,"forks":38,"open_issues":9,"watchers":65,"default_branch":"master"}},"base":{"label":"matrix-org:develop","ref":"develop","sha":"1fbc938f87ced85c457ba4d09cebc1bb546dbbc0","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":37144575,"name":"matrix-react-sdk","full_name":"matrix-org/matrix-react-sdk","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-react-sdk","description":"Matrix SDK for React Javascript","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-react-sdk","forks_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/matrix-react-sdk/deployments","created_at":"2015-06-09T16:37:07Z","updated_at":"2016-12-10T07:39:08Z","pushed_at":"2016-12-15T16:16:55Z","git_url":"git://github.com/matrix-org/matrix-react-sdk.git","ssh_url":"git@github.com:matrix-org/matrix-react-sdk.git","clone_url":"https://github.com/matrix-org/matrix-react-sdk.git","svn_url":"https://github.com/matrix-org/matrix-react-sdk","homepage":null,"size":4105,"stargazers_count":65,"watchers_count":65,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":9,"forks":38,"open_issues":9,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590"},"html":{"href":"https://github.com/matrix-org/matrix-react-sdk/pull/590"},"issue":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/590"},"comments":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/issues/590/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/pulls/590/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-org/matrix-react-sdk/statuses/55f85befc1c3e512cb63477e08ea884bf8a99778"}}}}
{"actor":{"display_login":"richvdh"}}